Quote:
Originally Posted by Old Pedant
Iyou use ID then getElementsByName() won't work if the name and ID aren't the same.
And I dunno how getElementsByName() behaves on a set of radio buttons. Is it the same in all browsers??
.
|
input names are probably pretty cohesive between browsers. but name's behavior on non-form elements is inconstant, notably so in IE.
if you need to grab a few non-form elements, use document.getElementById in conjunction with unique ids.
if you need several, or a couple groups of non-form elements, use class attribs and the ubiquitous getElementsByClass, available in the "post a javascript" section.
if you just want to grab groups of inputs, i apologize for any confusion, getElementsByName should work just fine for that.