...

View Full Version : is child nodes the right choice?



pricecd
04-19-2006, 02:14 AM
After click a submit button for a javascript quiz I want text that links to a page with the correct answer if the user guess incorrectly to appear. Would using child nodes to change the data in a table be the best course of action?

Kravvitz
04-19-2006, 03:48 AM
I suppose so, though your question seems a bit vague.

Kor
04-19-2006, 06:49 AM
I would rather use getElementsByTagName() as a subsequent reference instead of childNodes[], as IE and Moz counts in different ways the possible textNodes (the so called "gaps"). Or, if using childNodes or sibling elements, I would check in a while loop is the element I am looking for is a tag or not (on using nodeType).

vwphillips
04-19-2006, 08:05 AM
you can distinguish between text and element nodes using nodeType

1 = element
3 = text node



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum