HTML Entities Generator
Several generators are incorporated into my personal portal page, the web page on my hard drive that is my browser's home page.
One of those is an HTML entities generator. It's for those instances where I need to obfuscate some web page source code, yet have no need for high security.
The source code for an HTML entities generator is further below. But first, a working example:
Type the content to encode into the first box. Click the button. The encoded content is published in the second box.
Here is the source code for the above example.
<form> <textarea id="input_id" style="width:170px; height:100px;" nowrap></textarea> <input type="button" style="width:120px; vertical-align:45px;" onclick="EncodeString()" value="Convert -->"> <textarea id="output_id" style="width:170px; height:100px;" nowrap></textarea> </form> <script type="text/javascript"> function EncodeString() { var output_id = new String(); var input_id = document.getElementById("input_id").value; var ss = new String(); for( i = 0; i < input_id.length; i++) { output_id += '&#' + input_id.charCodeAt(i) + ';'; } document.getElementById("output_id").value = output_id; } </script>
To use, copy the above code and paste it into a web page.
The size of the textarea boxes may be adjusted, if you wish. The layout of the form may be changed. Design the generator for your visual pleasure.
But keep the id values as they are unless you also make corresponding edits to the JavaScript.
Will Bontrager