[thelist] DOM - Retrieving child nodes using a compound expression

raskenbo raskenbo at gmail.com
Thu May 12 12:36:19 CDT 2005


Hi List.

I'm aware that a DOM interface exists (childNodes) to achieve
precisely what I am trying to. Unfortunately it has cross-browser
issues.

What I want is to retrieve all of the input elements that are located
within a specific div.

I've tried the following:
  var inputs = document.getElementById("questiona").getElementstByTagName("input");

Here's the error message that the Firefox JavaScript console throws
when I try the above code:
  Error: document.getElementById("questiona").getElementstByTagName is
not a function

I'm probably missing something obvious but I've spent too much time on
this and would really appreciate an "extra set of eyes".

Demo (with described problem)
http://www.kenchase.com/oca/badDOM/spamiqtest1.html

Demo (without guilty function)
http://www.kenchase.com/oca/demo/spamiqtest1.html

JavsScript: Next() and Validator() functions
http://www.kenchase.com/oca/badDOM/scripts/spamiqtest.js

Validator() function desciption:
Checks a group of radio buttons and returns true if one is selected or
false if none are selected.

TIA 
Ken Chase
Freelance Web Design
http://www.kenchase.com


More information about the thelist mailing list