DOMElement::setIdAttribute
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
Declares the attribute specified by name to be of type ID
Description
DOMElement::setIdAttribute(string $qualifiedName, bool $isId): void
Declares the attribute qualifiedName to be of type ID.
Parameters
qualifiedNameThe name of the attribute.
isIdSet it to true if you want
qualifiedNameto 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
qualifiedNameis not an attribute of this element.
See Also
DOMDocument::getElementByIdDOMElement::setIdAttributeNodeDOMElement::setIdAttributeNS