Reputation: 3
I create one web page (which display details in table) using html & js. Which works on firefox but not in IE.
function frontEnd()
{
try{
th1 = document.getElementById('th1');
th1.firstChild.nodeValue = "Technology";
th2 = document.getElementById('th2');
th2.firstChild.nodeValue = "Level of knowledge";
t1 = document.getElementById('t1');
t1.firstChild.nodeValue = "HTML";
tl1 = document.getElementById('tl1');
tl1.firstChild.nodeValue = "5";
document.getElementById('MyTab').style.visibility="visible";
}
catch(e)
{
alert(e);
}
}
th1 is an id of table heading, t1,tl1 are data id. Actually am trying to display static values in table when user clicks button. It works sucessfully in firefox, not in IE. When click button using IE it reflects an error "[Object Error]" Please tel me how to made the same code to work in IE.
Thanks, Naveen
Upvotes: 0
Views: 289
Reputation: 12575
Why don't you use JQuery or Prototype JavaScript library , they are cross browser compatible.
Jquery
http://api.jquery.com/first-child-selector/
Upvotes: 2