Return the target attribute of a link:
The getAttributeNode() method returns the attribute with the specified name, as an Attr object.
Read more about the Attr Node object in our Attr Node object reference.
Tip: Use the getAttribute if you just want to return the attribute value.
![]()
The getAttributeNode() method is supported in all major browsers.
| Parameter | Type | Description |
|---|---|---|
| attributename | String | Required. The name of the attribute you want to return |
| Type | Description |
|---|---|
| Attr object | The specified attribute node |
| DOM Version | Core Level 1 |
|---|
Your message has been sent to W3Schools.