hasAttribute
The hasAttribute
method returns a boolean
value indicating whether the specified attribute is present on the element.
Syntax
element.hasAttribute(attributeName);
Parameters
attributeName
: string- The name of the attribute to check for.
Return value
A boolean value indicating whether the attribute is present.