Hi all,
I am getting a strange error while trying to get-ElementById()- a tbody element. Here is the chunk of code
......Code:function displayStats(data, period, routesNo) { var tb = document.getElementById("resultsTbody"); var inforow = document.createElement('tr'); inforow.setAttribute("id", "aRow"); var infocell = document.createElement('td'); infocell.setAttribute("id", "infoCell"); infocell.innerHTML = "string"; inforow.appendChild(infocell); tb.appendChild(inforow); .... }
......
In FF i get the error: "tb has no properties"HTML Code:<table id="statisticsResultsTbl" border="1" width="600" align="center"> <thead class="tbodies" id="headTbody"> <tr class="darkBlue"> <td id="statsMainHd" align="center" class="db_title_12pt">Statistics Results</td> </tr> </thead> <tbody id="resultsTbody"></tbody> </table>
in IE7: 'null' is null or not an object
in opera is not working at all
What the heck...i have the same code elsewhere and it's working...
any ideas??
thanks in advance




Bookmarks