Name
Element.hasAttributeNS( ): determine whether this element has a specified attribute — DOM Level 2 Core:
Synopsis
boolean hasAttributeNS(StringnamespaceURI, StringlocalName);
Arguments
-
namespaceURI The unique namespace identifier for the attribute, or
nullfor no namespace.-
localName The name of the attribute within the specified namespace.
Returns
true if this element has
an explicitly specified value or a default value for the specified
attribute; false
otherwise.
Description
This method works like hasAttribute(
), except that the attribute to be checked for is
specified by namespace and name. This method is useful only with XML
documents that use namespaces.
See Also
Element.getAttributeNS(
), Element.hasAttribute(
), Element.setAttributeNS(
)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access