php8.5
Home/ Manual/ dom / dom/ The Dom\Attr class

The Dom\Attr class

Dom\Attr represents an attribute in the Dom\Element object.

Intro

Dom\Attr represents an attribute in the Dom\Element object.

This is the modern, spec-compliant equivalent of DOMAttr.

Class synopsis

class Dom\Attr extends Dom\Node { }

Properties

namespaceURI

The namespace URI of the attribute.

prefix

The namespace prefix of the attribute.

localName

The local name of the attribute.

name

The qualified name of the attribute.

value

The value of the attribute.

Note

Unlike the equivalent property in DOMAttr, this does not substitute entities.

ownerElement

The element that contains the attribute or null.

specified

Legacy option, always is true.

See Also

  • WHATWG specification of Attr

Attr

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