/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function HTMLEncode(str){ var result = ''; for(var i=0; i<str.length; i++){ result += '&#' + str.charCodeAt(i) + ';'; } return result; }