Element: getAttributeNodeNS() method
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
ThegetAttributeNodeNS() method of theElement interface returns the namespacedAttr node of an element.
This method is useful if you need the namespaced attribute'sinstance properties.If you only need the namespaced attribute's value, you can use thegetAttributeNS() method instead.
If you need theAttr node of an element in HTML documents and the attribute is not namespaced, use thegetAttributeNode() method instead.
In this article
Syntax
getAttributeNodeNS(namespace, nodeName)Parameters
Return value
The node for specified attribute.
Notes
getAttributeNodeNS is more specific thangetAttributeNode in that it allows you to specify attributes that are part of a particular namespace. The corresponding setter method issetAttributeNodeNS.
Specifications
| Specification |
|---|
| DOM> # dom-element-getattributenodens> |