Quick Tip: DOM scripting, childNodes[1] and firstChild

Apr 06 2005

Here’s a quick tip for anyone having problems with a Javascript that uses firstChild or childNodes [1] to either check for the existence of something or perform some other function – if it’s not working, make sure that you haven’t added any comments or line breaks immediately after the start of the parent node, as those will be considered the firstChild of the element and your script won’t work!

Filed under: Javascript.

Digg this article

Bookmark this article with del.icio.us

Previously: Child Trust Fund

Next: typoGenerator


Comments