From http://www.w3schools.com (Copyright Refsnes Data)
Complete Element Object Reference
The getAttribute() method gets an attribute value by name.
| elementNode.getAttribute(name) |
| Parameter | Description |
|---|---|
| name | Required. Specifies the attribute to get the attribute value from |
The following code fragment loads "books.xml" into xmlDoc using loadXMLDoc() and gets the value of the "category" attribute in all <book> elements:
Example
Output:
Try it yourself » |
Complete Element Object Reference
From http://www.w3schools.com (Copyright Refsnes Data)