Easy Tutorial
❮ Met Element Hasattributes Dom Nodes Access ❯

XML DOM hasAttributeNS() Method



Definition and Usage

The hasAttributeNS() method returns TRUE if the current element node has an attribute with the specified namespace and name, otherwise it returns FALSE.

Syntax

Parameter Description
ns Required. Specifies the namespace of the attribute to look for.
name Required. Specifies the name of the attribute to look for.

Example

The following code snippet uses loadXMLDoc() to load "books_ns.xml" into xmlDoc and checks if the first <title> element has an attribute with the specified namespace and name:

Example

Output:


❮ Met Element Hasattributes Dom Nodes Access ❯