...

View Full Version : IE JS Error when setting innerhtml



htmlster
05-02-2011, 08:45 PM
Hi,

I'm getting JS error while setting innerHTML for td tag.

I'm seeing this error only in IE.

Can any one please let me know on how i can resolve this.

AndrewGSW
05-02-2011, 09:05 PM
Apparently IE struggles when using innerHTML to amend tables.

Are you just putting some text into the cell? Then you could perhaps make use of this function:

function changeText(elem,changeVal){
if(elem.textContent){
elem.textContent = changeVal; // FF
}else{
elem.innerText = changeVal; // IE
}
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum