Reputation: 165
Many peoples are coding as document.FORMNAME
. more than document.forms.FORMNAME
.
sure. it works in any browsers.
also, document.FORMNAME.FIELDNAME
is most using style. not document.forms.FORMNAME.elements.FIELDNAME
.
is it W3C Standard? I can't find any similar references.
anybody can explain me?
Upvotes: 1
Views: 442
Reputation: 83006
Yes it does, in the HTML5 spec, under "Supported property names" of the document and form objects.
See http://www.w3.org/html/wg/drafts/html/master/dom.html#dom-document-namedItem-which for the form names on the document onkect
and http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#htmlformcontrolscollection for the field names on the form controls collection.
Upvotes: 2