Web: HTML Encoder

7:43 AM 0 Comments



This page will convert HTML special characters into HTML entities. The encoded text can then be inserted into another HTML document or blog posting and the reserved characters (such as < and &) will show up normally.
Enter your text in the form field below. The encoded result will be displayed in the lower field as you type.

Enter HTML to Encode:

HTML Encoded Result: (Click to Select All)

The HTML encoding is performed with this Javascript function:
/* encode html entities */
var char2entity = {  '"' : '&quot;',  '<' : '&lt;',  '>' : '&gt;',  '&' : '&amp;',  "'" : '&#39;' }; /* IE can't handle &apos; */
function encode_entities(str) {
  var rv = '';
  for (var i = 0; i < str.length; i++) {
    var ch = str.charAt(i);
    rv += char2entity[ch] || ch;  
  }  
  return rv;
}

Install Server Networking Programming

Support you how to install server, networking and Programming Easy

0 comments:

You can post comment with english language or indonesia language.
Anda bisa memberikan komentar dalam bahasa inggris atau bahasa indonesia.