You are on page 1of 1

23/10/2021 16:38 DOM - Attribute Object

DOM - Attribute Object

Attr interface represents an attribute in an Element object. Typically, the allowable values for the
attribute are defined in a schema associated with the document. Attr objects are not considered
as part of the document tree since they are not actually child nodes of the element they
describe. Thus for the child nodes parentNode, previousSibling and nextSibling the attribute
value is null.

Attributes
The following table lists the attributes of the Attribute object −

Attribute Type Description

name DOMString This gives the name of the attribute.

It is a boolean value which returns true if the attribute value


specified boolean
exists in the document.

value DOMString Returns the value of the attribute.

It gives the node to which attribute is associated or null if


ownerElement Element
attribute is not in use.

It returns whether the attribute is known to be of type ID (i.e.


isId boolean
to contain an identifier for its owner element) or not.

https://www.tutorialspoint.com/dom/dom_attribute_object.htm 1/1

You might also like