Convert Text to ASCII HTML Code


Calvin

Page Title

Convert Text to ASCII HTML code



*Featured Code Created by Calvin


Edit box below to see results



Source Code:

<html>
    <head>
        <title>Page Title</title>
        <style>
          html, body {
    width: 100%;
    height: 96%;
    margin: 0;
}

          #inp, #out {
    width: 92%;
    height: 40%;
    margin-bottom: 10px;
    padding: 2%;
    margin: 2%;
}

#inp {
    border-radius: 5px;
}

#out {
    border: none;
    background-color: #ccffcc;
}

h1 {
    text-align: center;
    margin-bottom: 0px;
}
        </style>
    </head>
    <body>
        <h1>
Convert Text to ASCII HTML code</h1>
<textarea id="inp">Sololearn - Join the largest community of mobile code learners today!</textarea>
        <textarea id="out"></textarea>
        <script>
            onload = main;
var inp, out;

function main() {
    inp = document.getElementById("inp");
    out = document.getElementById("out");
 
 
    inp.addEventListener("keyup", charsToAsciiCode, false);
 
    function charsToAsciiCode() {
        text = inp.value;
        out.value = text.split('').map(function(c) {
            return '&#' + c.charCodeAt(0) + ';';
        }).join('');     
    }
 
    charsToAsciiCode();
}
        </script>
    </body>
</html>


Click here to see and run this code via Sololearn








Try these Fun Games by Bobbie:


Ocean Treasures Game


Travel Blast Game New York


Play and Learn Russian


Battlestarship Game



Take a look at these Groovy Codes:


Fun IQ Test


Html Svg Starburst


Javascript Particles Fishes



Read the Latest Breaking Programming and Tech News, Great Articles and Tips:


Codenewz Programming and Tech News



Comments

Post a Comment

Popular posts from this blog

Multi-tap Keypad Text Entry

Crypto Mining