T
Thomas 'PointedEars' Lahn
Michael said:Michael said:[Multiple forms cannot have the same name attribute value.]
Yes, they certainly can.
<form action="" name="foo"><p></p></form>
<form action="" name="foo"><p></p></form>
is perfectly Valid HTML 4.01 (Strict!).
Based on what criteria? [...]
The HTML 4.01 Specification.
In the latter, yes. In the former, no. Neither Mozilla (including
recent Firefox releases), Netscape, nor Opera versions prior to 7.11
(possibly earlier, but definitely later than 7.03) return a
collection from the forms collection.
Yes, indeed. And the namedItem() method of the HTMLCollection
interface does not require them to. D'oh.
What's the getElementsByTagName method got to do with this?
Nothing, repeated typo.
As for getElementsByName, the answer there is actually quite simple:
the HTMLCollection interface is only meant to return single
Node-implementing objects via the item and namedItem methods (and the
property accessor equivalents). That browsers return a collection is
a product of DOM 0, not DOM 1 or 2. As such, the getElementsByName
method was meant to fill this void.
Of course, I'm not, nor have I been, a member of the HTML or DOM
Working Groups, so this is just my interpretation of events.
You're probably right.
PointedEars