
Code
1 function isIE(){ //ie?
2 if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1)
3 return true;
4 else
5 return false;
6 }
7
8 if(!isIE()){ //firefox innerText define
9 HTMLElement.prototype.__defineGetter__( "innerText",
10 function(){
11 var anyString = "";
12 var childS = this.childNodes;
13 for(var i=0; i<childS.length; i++) {
14 if(childS[i].nodeType==1)
15 anyString += childS[i].tagName=="BR" ? '\n' : childS[i].innerText;
16 else if(childS[i].nodeType==3)
17 anyString += childS[i].nodeValue;
18 }
19 return anyString;
20 }
21 );
22 HTMLElement.prototype.__defineSetter__( "innerText",
23 function(sText){
24 this.textContent=sText;
25 }
26 );
27 }