DOMElement::setIdAttributeNode
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
Declares the attribute specified by node to be of type ID
Description
DOMElement::setIdAttributeNode(DOMAttr $attr, bool $isId): void
Declares the attribute specified by attr to be of type ID.
Parameters
attrThe attribute node.
isIdSet it to true if you want
nameto be of type ID, false otherwise.
Return Values
Void
Errors/Exceptions
May throw a DOMException with the following error codes:
DOM_NO_MODIFICATION_ALLOWED_ERRRaised if the node is readonly.
DOM_NOT_FOUND_ERRRaised if
nameis not an attribute of this element.
See Also
DOMDocument::getElementByIdDOMElement::setIdAttributeDOMElement::setIdAttributeNS