Availability
DOM Level 1 HTML
Synopsis
Node[] getElementsByName(String elementName);
Arguments
elementName
The desired value for the name attribute.
Returns
An array (really a NodeList) of elements that have a
name attribute of the specified value. If no such
elements are found, the returned NodeList is empty and has a
length of 0.
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 an 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.
See Also
Document.getElementById( ), Document.getElementsByTagName( )
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.