Quick Tip: DOM scripting, childNodes[1] and firstChild
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.
Bookmark this article with del.icio.us
Previously: Child Trust Fund
Next: typoGenerator