Posted By

Jamie on 04/08/10


Tagged

escape javascript html code textarea


Versions (?)

Escape HTML for a textarea


 / Published in: JavaScript
 

  1. string.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");

Report this snippet  

You need to login to post a comment.