The Attr Interface

This interface represents an attribute of an element object. Attr objects are not considered part of the document tree; instead, they're considered properties of their elements.

The name Attribute

The name attribute returns the name of the attribute.

The value Attribute

The value attribute returns the value of the attribute.

The specified Attribute

This is a Boolean attribute. If a value is assigned to the attribute, either in the original document or by code, this value will be true.

This value will be false if the attribute has a default value from the DTD, either because the value is #FIXED or a default is supplied for an enumerated attribute.

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.