Element
class Element extends Node implements ParentNode, ChildNode (View source)
Represents an element.
This is the modern, spec-compliant equivalent of DOMElement.
Constants
| DOCUMENT_POSITION_DISCONNECTED |
|
| DOCUMENT_POSITION_PRECEDING |
|
| DOCUMENT_POSITION_FOLLOWING |
|
| DOCUMENT_POSITION_CONTAINS |
|
| DOCUMENT_POSITION_CONTAINED_BY |
|
| DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
|
Properties
| int | $nodeType | from Node | |
| string | $nodeName | from Node | |
| string | $baseURI | from Node | |
| bool | $isConnected | from Node | |
| Document|null | $ownerDocument | from Node | |
| Node|null | $parentNode | from Node | |
| Element|null | $parentElement | from Node | |
| Node> | $childNodes | from Node | |
| Node|null | $firstChild | from Node | |
| Node|null | $lastChild | from Node | |
| Node|null | $previousSibling | from Node | |
| Node|null | $nextSibling | from Node | |
| string|null | $nodeValue | from Node | |
| string|null | $textContent | from Node | |
| string|null | $namespaceURI | ||
| string|null | $prefix | ||
| string | $localName | ||
| string | $tagName | ||
| string | $id | ||
| string | $className | ||
|
HTMLCollection
Since: 8.5
|
$children | ||
| TokenList read-only | $classList | ||
| NamedNodeMap | $attributes | ||
| Element|null | $firstElementChild | ||
| Element|null | $lastElementChild | ||
| int | $childElementCount | ||
| Element|null | $previousElementSibling | ||
| Element|null | $nextElementSibling | ||
| string | $innerHTML | ||
| string | $outerHTML | ||
| string | $substitutedNodeValue |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Removes the node
Returns the first element that matches the CSS selectors
No description
No description
No description
No description
No description
No description
No description
Details
in
Node at line 423
Node
getRootNode(array $options = [])
No description
in
Node at line 427
bool
hasChildNodes()
No description
in
Node at line 438
void
normalize()
No description
in
Node at line 440
Node
cloneNode(bool $deep = false)
No description
in
Node at line 442
bool
isEqualNode(Node|null $otherNode)
No description
in
Node at line 444
bool
isSameNode(Node|null $otherNode)
No description
in
Node at line 452
int
compareDocumentPosition(Node $other)
No description
in
Node at line 454
bool
contains(Node|null $other)
No description
in
Node at line 456
string|null
lookupPrefix(string|null $namespace)
No description
in
Node at line 458
string|null
lookupNamespaceURI(string|null $prefix)
No description
in
Node at line 460
bool
isDefaultNamespace(string|null $namespace)
No description
in
Node at line 462
Node
insertBefore(Node $node, Node|null $child)
No description
in
Node at line 464
Node
appendChild(Node $node)
No description
in
Node at line 466
Node
replaceChild(Node $node, Node $child)
No description
in
Node at line 468
Node
removeChild(Node $child)
No description
in
Node at line 470
int
getLineNo()
No description
in
Node at line 472
string
getNodePath()
No description
in
Node at line 474
string|false
C14N(bool $exclusive = false, bool $withComments = false, array|null $xpath = null, array|null $nsPrefixes = null)
No description
in
Node at line 476
int|false
C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, array|null $xpath = null, array|null $nsPrefixes = null)
No description
in
Node at line 478
array
__sleep()
No description
in
Node at line 480
void
__wakeup()
No description
bool
hasAttributes()
No description
array
getAttributeNames()
No description
string|null
getAttribute(string $qualifiedName)
No description
string|null
getAttributeNS(string|null $namespace, string $localName)
No description
void
setAttribute(string $qualifiedName, string $value)
No description
void
setAttributeNS(string|null $namespace, string $qualifiedName, string $value)
No description
void
removeAttribute(string $qualifiedName)
No description
void
removeAttributeNS(string|null $namespace, string $localName)
No description
bool
toggleAttribute(string $qualifiedName, bool|null $force = null)
No description
bool
hasAttribute(string $qualifiedName)
No description
bool
hasAttributeNS(string|null $namespace, string $localName)
No description
Attr|null
getAttributeNode(string $qualifiedName)
No description
Attr|null
getAttributeNodeNS(string|null $namespace, string $localName)
No description
HTMLCollection
getElementsByTagName(string $qualifiedName)
No description
HTMLCollection
getElementsByTagNameNS(string|null $namespace, string $localName)
No description
void
insertAdjacentText(AdjacentPosition $where, string $data)
No description
void
setIdAttribute(string $qualifiedName, bool $isId)
No description
void
setIdAttributeNS(string|null $namespace, string $qualifiedName, bool $isId)
No description
void
setIdAttributeNode(Attr $attr, bool $isId)
No description
void
remove()
Removes the node
void
before(Node|string ...$nodes)
Adds nodes before the node
Adds the passed nodes before the node.
void
after(Node|string ...$nodes)
Adds nodes after the node
Adds the passed nodes after the node.
void
replaceWith(Node|string ...$nodes)
Replaces the node with new nodes
void
append(Node|string ...$nodes)
Appends nodes after the last child node
Appends one or many nodes to the list of children after the last child node.
void
prepend(Node|string ...$nodes)
Prepends nodes before the first child node
Prepends one or many nodes to the list of children before the first child node.
void
replaceChildren(Node|string ...$nodes)
Replace children in node
Element|null
querySelector(string $selectors)
Returns the first element that matches the CSS selectors
Returns the first element that matches the CSS selectors specified in selectors.
NodeList
querySelectorAll(string $selectors)
No description
Element|null
closest(string $selectors)
No description
bool
matches(string $selectors)
No description
array
getInScopeNamespaces()
No description
array
getDescendantNamespaces()
No description
void
rename(string|null $namespaceURI, string $qualifiedName)
No description
HTMLCollection
getElementsByClassName(string $classNames)
No description
void
insertAdjacentHTML(AdjacentPosition $where, string $string)
No description