DOM problem in IE 7 but not Firefox or Opera - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

DOM problem in IE 7 but not Firefox or Opera

Josh CodeJosh Code Posts: 675Member
I'm having a problem with manipulating the Document Object Model(DOM) for Internet Explorer. The code I used works in Firefox and Opera but not in Internet Explorer 7. It failed while testing it in IE version 7.0.6000.16681.

How it fails:
The DOM changes don't show. The JavaScript completes without throwing any exceptions but in Internet Explorer, the DOM changes are not visible.

Here is the code being referred to:

var questionNum=2;

Adds a question to a table by appending a new tr to that table's children
function addQuestion()
var table = document.getElementById("questions");
var td = document.createElement("td"); // a td to contain the statement
var tr = document.createElement("tr"); // a tr to contain the td

"Here is question "+questionNum));


alert("question added. Do you see it?");

Here is question 1.


Should something in this code be changed so it works for all browsers?

Is there a way to explicitly update or refresh the display to reveal the changes Internet Explorer seems to be hiding?

Do you have any other suggestion for clearing up this problem?
Sign In or Register to comment.