Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Element
  4. getAttributeNodeNS()

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.

Syntax

js
getAttributeNodeNS(namespace, nodeName)

Parameters

namespace

A string specifying the namespace of the attribute.

nodeName

A string specifying the name of the attribute.

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

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp