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

The Dom\Element class

Represents an element.

Intro

Represents an element.

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

Class synopsis

class Dom\Element extends Dom\Node implements Dom\ParentNode implements Dom\ChildNode { }

Properties

namespaceURI

The namespace URI of the element.

prefix

The namespace prefix of the element.

localName

The local name of the element.

tagName

The HTML-uppercased qualified name of the element.

classList

Returns an instance of Dom\TokenList to easily manage the classes on this element.

attributes

Returns an instance of Dom\NamedNodeMap that represents the attributes of this element.

innerHTML

The inner HTML (or XML for XML documents) of the element.

outerHTML

The outer HTML (or XML for XML documents) of the element, including the element itself. Available as of PHP 8.5.0.

substitutedNodeValue

The node value with entity substitution enabled.

Notes Utf8

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