attributes
Returns an array of attributes on the given element
Syntax
attributes = elementNode.attributes
Parameters
The attributes parameter returned by this property is a NamedNodeMap of attribute nodes.
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
attributes
Netscape Communications http://developer.netscape.com |