这篇翻译不完整。请帮忙从英语翻译这篇文章

removeAttributeNS 移除元素的指定属性

 在Firefox 3及更高版本中,此方法会将DOM值重置为其默认值。

用法

element.removeAttributeNS(namespace,attrName);
  • namespace 包含当前属性的namespace字符串
  • attrName 当前移除的属性名字符串

例子

// <div id="div1" xmlns:special="http://www.mozilla.org/ns/specialspace"
//      special:specialAlign="utterleft" width="200px" /> 
d = document.getElementById("div1"); 
d.removeAttributeNS("http://www.mozilla.org/ns/specialspace", "specialAlign"); 
// now: <div id="div1" width="200px" />

Notes

DOM methods dealing with element's attributes:

Not namespace-aware, most commonly used methods Namespace-aware variants (DOM Level 2) DOM Level 1 methods for dealing with Attr nodes directly (seldom used) DOM Level 2 namespace-aware methods for dealing with Attr nodes directly (seldom used)
setAttribute (DOM 1) setAttributeNS setAttributeNode setAttributeNodeNS
getAttribute (DOM 1) getAttributeNS getAttributeNode getAttributeNodeNS
hasAttribute (DOM 2) hasAttributeNS - -
removeAttribute (DOM 1) removeAttributeNS removeAttributeNode -

Specification

DOM Level 2 Core: removeAttributeNS

文档标签和贡献者

此页面的贡献者: Eason.Wu
最后编辑者: Eason.Wu,