Convert Text to ASCII HTML Code
Calvin
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
html example codes for beginners Font for label element
ReplyDelete