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.
The getAttributeNodeNS() method of the Element interface returns the specified namespaced attribute of the specified element, as an Attr node. It returns null if the element doesn't have an attribute with the given name in the namespace.
This method is useful if you need the namespaced attribute's instance properties.
If you only need the namespaced attribute's value, you can use the getAttributeNS() method instead.
If you are working with HTML documents and you don't need to specify the requested attribute as being part of a specific namespace, use the getAttributeNode() method instead.
Syntax
getAttributeNodeNS(namespace, localName)
Parameters
Return value
An Attr node for the attribute, or null if the element doesn't have an attribute with the given name in the namespace.
Specifications
| Specification |
|---|
| DOM> # dom-element-getattributenodens> |