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::getElementsByTagNameNSDOMElement::hasAttributeNS>
^DOMElementLast updated: Mon, 26 Oct 2026

DOMElement::hasAttribute

(PHP 5, PHP 7, PHP 8)

DOMElement::hasAttribute — Checks to see if attribute exists

Description

public function DOMElement::hasAttribute(string $qualifiedName): bool

Indicates whether attribute named qualifiedName exists as a member of the element.

Parameters

qualifiedName

The attribute name.

Return Values

Returns true on success or false on failure.

See Also


<DOMElement::getElementsByTagNameNSDOMElement::hasAttributeNS>
^DOMElementLast updated: Mon, 26 Oct 2026