DOM Attributes

Attr Object

Represents an HTML attribute. (A DOM Attribute always belongs to a DOM Element.)
Property / Method Description
attr.isIdReturns true if the attribute is of type Id, otherwise it returns false
attr.nameReturns the name of an attribute
attr.valueSets or returns the value of the attribute
attr.specifiedReturns true if the attribute has been specified, otherwise it returns false

NamedNodeMap Object

Represents a(n unordered) collection of an element's attribute nodes.
Property / Method Description
nodemap.getNamedItem()Returns a specified attribute node from a NamedNodeMap
nodemap.item()Returns the attribute node at a specified index in a NamedNodeMap
nodemap.lengthReturns the number of attribute nodes in a NamedNodeMap
nodemap.removeNamedItem()Removes a specified attribute node
nodemap.setNamedItem()Sets the specified attribute node (by name)