appendChild does not properly set parentElement

I may be misunderstanding the correct usage of this function, but I believe appendChild is working incorrectly in Firefox. I have a very large script that has worked fine in IE since version 6. We're now trying to make this script work in all browsers, so I'm starting to test in FF.

Here's some relevant lines from the script, modified for easier reading here:

var tempDocFragment = document.createDocumentFragment();
var tempNewtbody = document.createElement("tbody"); 
trElem = document.createElement("tr");
tdElem = document.createElement("td");


Code like the above runs within a loop that adds between 0 and 1000+ table rows to a table. This all appears to work fine and the table rows appear in the table. However, the table rows have an onmouseover event that runs this line of code:


This returns 'undefined' in Firefox, but returns the proper parentElement on IE. So it appears that Firefox is running the code to append the child elements correctly, but somehow fails to associate any parent with those child elements. I would appreciate any insight into what I may be doing wrong.



parentElement is not supported in Firefox < 9. It started life as a non-standard property of elements in IE 4 and has relatively recently been standardized in DOM4.

Use parentNode instead.

the standard way is to use parentNode, it will work on all browsers

Need Your Help

How to test if Geoloqi push notifications are working or not?

iphone objective-c ios location push-notification

For normal push notifications, when something new is added to a site, a push notification is sent to the device.

Removing rows that don't contain strings from csv file, using one-line reg exp grep/sed

regex file sed grep

I have idsfile.csv which is a comma separated file of ids (with no new line characters in),