×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Chris Emerson
Added: Aug 24, 2012 1:57 PM
Views: 21
Tags: no tags
  1.  function escapeHTMLEncode(str) {
  2.   var div = document.createElement(‘div’);
  3.   var text = document.createTextNode(str);
  4.   div.appendChild(text);
  5.   return div.innerHTML;
  6.  }