diff options
Diffstat (limited to 'files/zh-cn/web/api/element/removeattributens/index.html')
-rw-r--r-- | files/zh-cn/web/api/element/removeattributens/index.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/element/removeattributens/index.html b/files/zh-cn/web/api/element/removeattributens/index.html new file mode 100644 index 0000000000..f1c35b27fd --- /dev/null +++ b/files/zh-cn/web/api/element/removeattributens/index.html @@ -0,0 +1,37 @@ +--- +title: Element.removeAttributeNS() +slug: Web/API/Element/removeAttributeNS +translation_of: Web/API/Element/removeAttributeNS +--- +<p>{{ APIRef("DOM") }}</p> + +<p><code>removeAttributeNS</code> 移除元素的指定属性</p> + +<p>{{ Fx_minversion_inline(3) }} 在Firefox 3及更高版本中,此方法会将DOM值重置为其默认值。</p> + +<h2 id="Syntax" name="Syntax">用法</h2> + +<pre class="eval"><em>element</em>.removeAttributeNS(<em>namespace</em>,<em>attrName</em>); +</pre> + +<ul> + <li><code>namespace</code> 包含当前属性的namespace字符串</li> + <li><code>attrName</code> 当前移除的属性名字符串</li> +</ul> + +<h2 id="Example" name="Example">例子</h2> + +<pre>// <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" /> +</pre> + +<h2 id="Notes" name="Notes">Notes</h2> + +<p>{{ DOMAttributeMethods() }}</p> + +<h2 id="Specification" name="Specification">Specification</h2> + +<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElRemAtNS">DOM Level 2 Core: removeAttributeNS</a></p> |