diff options
Diffstat (limited to 'files/ja/web/api/element/setattributenodens/index.html')
| -rw-r--r-- | files/ja/web/api/element/setattributenodens/index.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/files/ja/web/api/element/setattributenodens/index.html b/files/ja/web/api/element/setattributenodens/index.html new file mode 100644 index 0000000000..11aea740fd --- /dev/null +++ b/files/ja/web/api/element/setattributenodens/index.html @@ -0,0 +1,50 @@ +--- +title: element.setAttributeNodeNS +slug: Web/API/Element/setAttributeNodeNS +tags: + - DOM + - Gecko + - 翻訳中 +translation_of: Web/API/Element/setAttributeNodeNS +--- +<p><span class="comment"><breadcrumbs></breadcrumbs></span>{{ ApiRef("DOM") }}<span class="comment">== Summary ==</span></p> + +<h3 id=".E6.A6.82.E8.A6.81" name=".E6.A6.82.E8.A6.81">概要</h3> + +<p><span class="comment"><code>setAttributeNodeNS</code> adds a new attribute node with the specified namespace and name.</span> <code>setAttributeNodeNS</code> は指定の名前空間と名前で新しい属性ノードを追加します。<span class="comment">== Syntax ==</span></p> + +<h3 id=".E6.A7.8B.E6.96.87" name=".E6.A7.8B.E6.96.87">構文</h3> + +<pre class="eval"><em>replacedAttr</em> = element.setAttributeNodeNS(<em>attributeNode</em>) +</pre> + +<p><span class="comment">* <code>replacedAttr</code> is the replaced attribute node, if any, returned by this function. * <code>attributeNode</code> is an <code>Attr</code> node.</span></p> + +<ul> + <li><code>replacedAttr</code> は、この関数によって返されるのであれば、置き換えられた属性ノードです。</li> + <li><code>attributeNode</code> は <code>Attr</code> ノードです.</li> +</ul> + +<h3 id="Example" name="Example">Example</h3> + +<pre>// <div id="one" special-align="utterleft">one</div> +// <div id="two">two</div> + +var myns = "http://www.mozilla.org/ns/specialspace"; +var d1 = document.getElementById("one"); +var d2 = document.getElementById("two"); +var a = d1.getAttributeNodeNS(myns, "special-align"); +d2.setAttributeNodeNS(a); + +alert(d2.attributes[1].value) // returns: `utterleft' +</pre> + +<h3 id=".E6.B3.A8.E8.A8.98" name=".E6.B3.A8.E8.A8.98">注記</h3> + +<p><span class="comment">If the specified attribute already exists on the element, then that attribute is replaced with the new one and the replaced one is returned.</span> 指定の属性が既に存在しているときは、その属性新しいものに置き換えられ、置き換えられたものが戻り値として返されます。</p> + +<p>{{ DOMAttributeMethods() }}<span class="comment">== Specification ==</span></p> + +<h3 id=".E4.BB.95.E6.A7.98" name=".E4.BB.95.E6.A7.98">仕様</h3> + +<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAtNodeNS">DOM Level 2 Core: setAttributeNodeNS</a></p> |
