diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
commit | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch) | |
tree | 0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/api/element/setattributens | |
parent | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff) | |
download | translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2 translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip |
initial commit
Diffstat (limited to 'files/es/web/api/element/setattributens')
-rw-r--r-- | files/es/web/api/element/setattributens/index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/files/es/web/api/element/setattributens/index.html b/files/es/web/api/element/setattributens/index.html new file mode 100644 index 0000000000..59a4d9809e --- /dev/null +++ b/files/es/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 añade un nuevo atributo o cambia el valor de un atributo con el namespace dado y el nombre.</code></p> + +<h2 id="Sintaxis">Sintaxis</h2> + +<pre class="eval"><em>elemento</em>.setAttributeNS(<em>namespace</em>,<em>nombre</em>,<em>valor</em>) +</pre> + +<ul> + <li><code>namespace</code> es un string especificando el namespace del atributo.</li> + <li><code>name es un string identificando el atributo a ser puesto.</code></li> + <li><code>value es el string del valor deseado del nuevo atributo.</code></li> +</ul> + +<h2 id="Example" name="Example">Ejemplo</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">Especificación</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> |