attributes
Returns an array of attributes on the given element.
Syntax
attributes = elementNode.attributes
Parameters
attributes is a namedNodeMap of attributes on the current element.
Example
// get the first <p> element in the document para = document.getElementsByTag("p")[0]; atts = para.attributes;
Notes
The array returned by this property is a namedNodeMap, a list of objects rather than strings. The name and value of the attribute objects are accessible as separate properties, as in the following complete example, which retrieves the name/value pair of the first attribute of the "p1" paragraph in the document:
Specification
attribute
Netscape Communications http://developer.netscape.com |