php8.5
Home/ Manual/ dom / domelement/ DOMElement::removeAttribute

DOMElement::removeAttribute

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Removes attribute

Description

DOMElement::removeAttribute(string $qualifiedName): bool

Removes attribute named qualifiedName from the element.

Parameters

qualifiedName

The name of the attribute.

Return Values

Success

Errors/Exceptions

May throw a DOMException with the following error codes:

DOM_NO_MODIFICATION_ALLOWED_ERR

Raised if the node is readonly.

See Also

  • DOMElement::hasAttribute
  • DOMElement::getAttribute
  • DOMElement::setAttribute

Source: reference/dom/domelement/removeattribute.xml · from the official PHP manual (php/doc-en)