php8.5
Home/ Manual/ reference / dom/ The DOMAttr class

The DOMAttr class

DOMAttr represents an attribute in the DOMElement object.

Intro

DOMAttr represents an attribute in the DOMElement object.

Class synopsis

class DOMAttr extends DOMNode { }

Properties

name

The name of the attribute.

ownerElement

The element which contains the attribute or null.

schemaTypeInfo

Not implemented yet, always is null.

specified

Not implemented yet, always is true.

value

The value of the attribute.

Note

Note, XML entities are expanded upon setting a value. Thus the & character has a special meaning. Setting value to itself will fail when value contains an &. To avoid entity expansion, use DOMElement::setAttribute instead.

See Also

  • W3C specification of Attr

Domattr

In this section

Source: reference/dom/domattr.xml · from the official PHP manual (php/doc-en)