The hasAttribute() method checks if the current element has an attribute with the specified name. It returns true if the attribute exists and false otherwise.
Description
public ElementNode::hasAttribute(string $name): bool
Parameters
name
The name of the attribute to check, as a string.
Return Value
Returns a bool indicating whether the element has the specified attribute.
Exceptions
None