Element: getAttributeNodeNS() 方法
Element 介面的 getAttributeNodeNS() 方法返回元素的名稱空間 Attr 節點。
如果您需要獲取名稱空間屬性的 例項屬性,此方法將非常有用。如果您只需要名稱空間屬性的值,則可以使用 getAttributeNS() 方法代替。
如果您在 HTML 文件中需要元素的 Attr 節點,並且該屬性沒有名稱空間,請使用 getAttributeNode() 方法代替。
語法
js
getAttributeNodeNS(namespace, nodeName)
引數
返回值
指定屬性的節點。
注意
getAttributeNodeNS 比 getAttributeNode 更具體,因為它允許您指定屬於特定名稱空間的屬性。對應的設定器方法是 setAttributeNodeNS。
規範
| 規範 |
|---|
| DOM # dom-element-getattributenodens |
瀏覽器相容性
載入中…