Section 25.152. HTMLDocument.getElementsByName( ): find elements with the specified name attribute


25.152. HTMLDocument.getElementsByName( ): find elements with the specified name attribute

DOM Level 2 HTML

25.152.1. Synopsis

 Element[] getElementsByName(String elementName); 

25.152.1.1. Arguments

elementName

The desired value for the name attribute.

25.152.1.2. Returns

A read-only array (technically a NodeList) of Element objects that have a name attribute with the specified value. If no such elements are found, the returned array is empty and has a length of 0.

25.152.2. Description

This method searches an HTML document tree for Element nodes that have a name attribute of the specified value and returns a NodeList (which you can treat as a read-only array) containing all matching elements. If there are no matching elements, a NodeList with length 0 is returned.

Do not confuse this method with the Document.getElementById( ) method, which finds a single Element based on the unique value of an id attribute, or with the Document.getElementsByTagName( ) method, which returns a NodeList of elements with the specified tag name.

25.152.3. See Also

Document.getElementById( ), Document.getElementsByTagName( )




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net