DOM - Attribute
Attr object
The Attr object represents the attribute of the Element object. The allowed values for a property are usually defined in the DTD.
Since the Attr object is also a node, it inherits the properties and methods of the Node object. However, properties cannot have a parent node, and properties are not considered children of elements. Many Node properties will return null.
Attr Object Attribute
Attribute | Description |
---|---|
baseURI | Return the absolute base URI of the attribute. |
isId | Returns true if the attribute is of type ID, false otherwise. |
localName | Returns the local part of the property name. |
name | Returns the name of the attribute. |
namespaceURI | Returns the namespace URI of the property. |
nodeName | Returns the name of the node, according to its type. |
nodeType | Returns the type of node. |
nodeValue | Sets or returns the value of a node, according to its type. |
ownerDocument | Returns the root element (document object) to which the attribute belongs. |
ownerElement | Returns the element node to which the attribute is attached. |
prefix | Sets or returns the namespace prefix of the attribute. |
schemaTypeInfo | Returns the type information associated with the attribute. |
specified | Returns true if the attribute value is set in the document, false if its default value is set in the DTD/Schema. |
textContent | Sets or returns the text content of the property. |
value | Set or return the value of the attribute. |