The ElementNode
class is a specialized type of node that represents an HTML (or XML) element within a document. It extends from the abstract AbstractNode class and implements the ElementInterface
, providing additional functionality specific to element manipulation.
In the context of UssElement, the ElementNode
class allows for handling elements like <div>
, <span>
, and other HTML tags, encapsulating their attributes, content, and child nodes. This class provides various methods to access, modify, and manipulate elements within a document tree, aligning closely with the behaviors of HTML DOM elements but in a more streamlined and object-oriented manner suitable for PHP developers.
Declaration
class ElementNode extends AbstractNode implements ElementInterface
Methods
- getAttribute
- getAttributes
- getAttributeNames
- getChildren
- getCloseTag
- getClassList
- getElementById
- getElementsByClassName
- getElementsByTagName
- getFirstElementChild
- getInnerHtml
- getLastElementChild
- getNextElementSibling
- getOpenTag
- getPreviousElementSibling
- getTagName
- hasAttribute
- hasAttributes
- isVoid
- matches
- querySelector
- querySelectorAll
- removeAttribute
- setAttribute
- setInnerHtml
- setVoid
inherited methods
- appendChild
- clearChildNodes
- cloneNode
- getChild
- getChildNodes
- getFirstChild
- getLastChild
- getNextSibling
- getNodeId
- getNodeName
- getNodeType
- getParentElement
- getParentElements
- getParentNode
- getParentNodes
- getPreviousSibling
- hasChild
- hasSibling
- insertAfter
- insertBefore
- insertChildAtPosition
- isVisible
- moveAfterSibling
- moveBeforeSibling
- moveToFirstSibling
- moveToLastSibling
- moveToSiblingPosition
- prependChild
- removeChild
- render
- replaceChild
- setVisible
- sortChildNodes
- toJson