aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/element/setattributens/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/api/element/setattributens/index.html')
-rw-r--r--files/pt-br/web/api/element/setattributens/index.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/files/pt-br/web/api/element/setattributens/index.html b/files/pt-br/web/api/element/setattributens/index.html
new file mode 100644
index 0000000000..d4837965a7
--- /dev/null
+++ b/files/pt-br/web/api/element/setattributens/index.html
@@ -0,0 +1,33 @@
+---
+title: Element.setAttributeNS()
+slug: Web/API/Element/setAttributeNS
+translation_of: Web/API/Element/setAttributeNS
+---
+<p>{{ APIRef("DOM") }}</p>
+
+<p><code>setAttributeNS</code> adiciona um novo atributo ou modifica o valor de um atributo com um namespace e um nome.</p>
+
+<p>Syntax</p>
+
+<pre class="eval"><em>element</em>.setAttributeNS(<em>namespace</em>,<em>name</em>,<em>value</em>)
+</pre>
+
+<ul>
+ <li><code>namespace</code> é uma string especificando o namespace do atributo.</li>
+ <li><code>name</code> é uma string identificando o atributo que sera definido.</li>
+ <li><code>value</code> é o novo valor desejado para o atributo.</li>
+</ul>
+
+<h2 id="Example" name="Example">Exemplo</h2>
+
+<pre class="eval">var d = document.getElementById("d1");
+d.setAttributeNS("<span class="nowiki">http://www.mozilla.org/ns/specialspace</span>", "align", "center");
+</pre>
+
+<h2 id="Notes" name="Notes">Notas</h2>
+
+<p>{{ DOMAttributeMethods() }}</p>
+
+<h2 id="Specification" name="Specification">Especificação</h2>
+
+<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAttrNS">DOM Level 2 Core: setAttributeNS</a></p>