25.146. HTMLCollection.namedItem( ): get an element by nameDOM Level 2 HTML25.146.1. Synopsis
25.146.1.1. Arguments
25.146.1.2. ReturnsThe element in the collection that has the specified value for its id or name attribute, or null if no elements in the HTMLCollection have that name. 25.146.2. DescriptionThis method finds and returns an element from the HTMLCollection that has the specified name. If any element has an id attribute whose value is the specified name, that element is returned. If no such element is found, an element whose name attribute has the specified value is returned. If no such element exists, namedItem( ) returns null. Note that any HTML element may be given an id attribute, but only certain HTML elementssuch as forms, form elements, images, and anchorsmay have a name attribute. In JavaScript, it is easier to treat the HTMLCollection as an associative array and to specify name between square brackets using array notation. 25.146.3. Example
|
Thursday, October 29, 2009
Section 25.146. HTMLCollection.namedItem( ): get an element by name
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment