From http://www.w3schools.com (Copyright Refsnes Data)
Complete Element Object Reference
The hasAttributeNS() method returns TRUE if the current element node has the attribute specified by namespace and name, and FALSE otherwise.
| hasAttributeNS(ns,name) |
| Parameter | Description |
|---|---|
| ns | Required. Specifies the namespace of the attribute to find |
| name | Required. Specifies the name of the attribute to find |
The following code fragment loads "books_ns.xml" into xmlDoc using loadXMLDoc() and checks if the first <title> element has any attributes of the specified namespace and name:
Example
Output:
Try it yourself » |
Complete Element Object Reference
From http://www.w3schools.com (Copyright Refsnes Data)