Element: getAttributeNodeNS() method


目录

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

Browser compatibility

See also


版本号 #3
由 壳壳虫 创建于 2026-10-31 03:27:53 UTC
由 cocobook-sync 更新于 2026-11-04 17:34:22 UTC