![]() |
|
|
+ Search |
![]()
|
May 26th, 2005 06:13
Marius Strumyla, Thor Larholm,
if(typeof HTMLElement!="undefined"){
HTMLElement.prototype.innerText getter = function(){
var tmp = this.innerHTML.replace(/<br>/gi,"\n");
return tmp.replace(/<[^>]+>/g,"");
}
HTMLElement.prototype.innerText setter = function(txtStr){
var parsedText = document.createTextNode(txtStr);
this.innerHTML = "";
this.appendChild( parsedText );
}
}