Element Object
The getAttribute() method gets an attribute value by 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:
Output:
Element Object
Your message has been sent to W3Schools.