DOMElement::removeAttributeNode
(PHP 5, PHP 7, PHP 8)
DOMElement::removeAttributeNode — Removes attribute
說明
Removes attribute attr
from the element.
參數
-
attr
-
The attribute node.
返回值
成功時返回 true
, 或者在失敗時返回 false
。
錯誤/異常
-
DOM_NO_MODIFICATION_ALLOWED_ERR
-
Raised if the node is readonly.
-
DOM_NOT_FOUND_ERROR
-
Raised if
attr
is not an attribute of the element.
參見
- DOMElement::hasAttribute() - Checks to see if attribute exists
- DOMElement::getAttributeNode() - Returns attribute node
- DOMElement::setAttributeNode() - Adds new attribute node to element