I modify document.getElementById(\'\').innerHTML
with Java Script in a page. It\'s working fine in Firefox, but not IE8. Please see below for more details:
I believe IE behaves strangely when you play with the innerHTML of tr
elements. I would select the row with getElementById
, and then select the td and alter that one's innerHTML:
document.getElementById('abc').firstChild.innerHTML = 'abc';
(Though you have to be careful with this: often the whitespace between the tr and the td will be considered a valid node)
There's a whole heap of special functions for working with tables in the DOM
var tblBody = document.getElementById(tblId).tBodies[0];
var newRow = tblBody.insertRow(-1);
var newCell0 = newRow.insertCell(0);
See all the functions here: http://www.mredkj.com/tutorials/tablebasics1.html
Thanks its very helpful .html()
I was using
document.getElementById('site'+cValue).innerHTML=tableReadyElem; //work with mozila not ie
$(document.getElementById('site'+cValue)).html(tableReadyElem);//work for both