Javascript Detects InnerText and Strips HTML Tags

[Total: 0    Average: 0/5]

This code will strip out all HTML tags from a given HTML element.

Head Code:

function ex_init()
  var temp="";
  var regExp=/<S[^>]*>/g;
  var _obj=document.getElementById("me");

Init Code:


Body Code:

<h1 id="me"><b>Hi<i> There</i></b></h1>
<form name=f1>
InnerHTML:<textarea name=t1></textarea><BR>
Replaced:<textarea name=t2></textarea><BR>

Times Viewed: 10

Leave a Reply

Your email address will not be published. Required fields are marked *