Node.js examples for String:HTML String
HTML escape using Document
String.prototype.htmlEscape = function(){ var span = document.createElement('span'); var txt = document.createTextNode(''); span.appendChild(txt);//from www . ja va 2 s . co m txt.data = this; return span.innerHTML; };