Posted By

arpo on 02/16/10


Tagged


Versions (?)

removeHTML


 / Published in: JavaScript
 

  1. function removeHTML(strInputCode)
  2. {
  3. strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
  4. return (p1 == "lt")? "<" : ">";
  5. });
  6. var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
  7.  
  8. return strTagStrippedText;
  9. }

Report this snippet  

You need to login to post a comment.