Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<DOMElement::removeAttributeDOMElement::removeAttributeNS>
^DOMElementLast updated: Mon, 26 Oct 2026

DOMElement::removeAttributeNode

(PHP 5, PHP 7, PHP 8)

DOMElement::removeAttributeNode — Removes attribute

Description

public function DOMElement::removeAttributeNode(DOMAttr $attr): DOMAttr|false

Removes attribute attr from the element.

Parameters

attr

The attribute node.

Return Values

Returns true on success or false on failure.

Errors/Exceptions

May throw a DOMException with the following error codes:

DOM_NO_MODIFICATION_ALLOWED_ERR

Raised if the node is readonly.

DOM_NOT_FOUND_ERR

Raised if attr is not an attribute of the element.

See Also


<DOMElement::removeAttributeDOMElement::removeAttributeNS>
^DOMElementLast updated: Mon, 26 Oct 2026