how to make innerText work in Mozilla/Netscape suite
if(typeof HTMLElement!="undefined"){
HTMLElement.prototype.innerText getter = function(){
var tmp = this.innerHTML.replace(/
/gi,"\n");
return tmp.replace(/<[^>]+>/g,"");
}
HTMLElement.prototype.innerText setter = function(txtStr){
var parsedText = document.createTextNode(txtStr);
this.innerHTML = "";
this.appendChild( parsedText );
}
}
Just place the above in ur java script.
HTMLElement.prototype.innerText getter = function(){
var tmp = this.innerHTML.replace(/
/gi,"\n");
return tmp.replace(/<[^>]+>/g,"");
}
HTMLElement.prototype.innerText setter = function(txtStr){
var parsedText = document.createTextNode(txtStr);
this.innerHTML = "";
this.appendChild( parsedText );
}
}
Just place the above in ur java script.
0 Comments:
Post a Comment
<< Home