aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/element/setattributenodens
diff options
context:
space:
mode:
authorjulieng <julien.gattelier@gmail.com>2021-10-02 17:20:24 +0200
committerSphinxKnight <SphinxKnight@users.noreply.github.com>2021-10-02 17:30:20 +0200
commit1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch)
tree30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/element/setattributenodens
parentc05efa8d7ae464235cf83d7c0956e42dc6974103 (diff)
downloadtranslated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz
translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2
translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip
convert content to md
Diffstat (limited to 'files/fr/web/api/element/setattributenodens')
-rw-r--r--files/fr/web/api/element/setattributenodens/index.md52
1 files changed, 23 insertions, 29 deletions
diff --git a/files/fr/web/api/element/setattributenodens/index.md b/files/fr/web/api/element/setattributenodens/index.md
index b2abe3c907..a93dd4f72e 100644
--- a/files/fr/web/api/element/setattributenodens/index.md
+++ b/files/fr/web/api/element/setattributenodens/index.md
@@ -8,46 +8,40 @@ tags:
- Méthodes
translation_of: Web/API/Element/setAttributeNodeNS
---
-<p>{{ APIRef("DOM") }}</p>
+{{ APIRef("DOM") }}
-<p><code>setAttributeNodeNS</code> ajoute un nouveau nœud attribut avec l'espace de noms et le nom spécifiés.</p>
+`setAttributeNodeNS` ajoute un nouveau nœud attribut avec l'espace de noms et le nom spécifiés.
-<h2 id="Syntaxe">Syntaxe</h2>
+## Syntaxe
-<pre class="eval"><em>replacedAttr</em> = element.setAttributeNodeNS(<em>attributeNode</em>)
-</pre>
+ replacedAttr = element.setAttributeNodeNS(attributeNode)
-<dl>
- <dt><code>replacedAttr</code></dt>
- <dd>Le nœud attribut remplacé, si applicable, renvoyé par cette fonction.</dd>
- <dt><code>attributeNode</code></dt>
- <dd>Un nœud <code>Attr</code>.</dd>
-</dl>
+- `replacedAttr`
+ - : Le nœud attribut remplacé, si applicable, renvoyé par cette fonction.
+- `attributeNode`
+ - : Un nœud `Attr`.
-<h2 id="Exemple">Exemple</h2>
+## Exemple
-<pre>// &lt;div id="one" special-align="utterleft"&gt;one&lt;/div&gt;
-// &lt;div id="two"&gt;two&lt;/div&gt;
+ // <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);
+ 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) // renvoie : "utterleft"
-</pre>
+ alert(d2.attributes[1].value) // renvoie : "utterleft"
-<h2 id="Notes">Notes</h2>
+## Notes
-<p>Si l'attribut spécifié existe déjà sur l'élément, cet attribut est remplacé par le nouveau et l'ancien est renvoyé.</p>
+Si l'attribut spécifié existe déjà sur l'élément, cet attribut est remplacé par le nouveau et l'ancien est renvoyé.
-<p>Notez que si vous essayez de définir sans cloner le noeud, Mozilla donne une erreur "Attribut déjà utilisé" NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR, car le DOM nécessite que le clonage d'<code>Attr</code> soit réutilisé (contrairement aux autres Noeuds qui peuvent être déplacés).</p>
+Notez que si vous essayez de définir sans cloner le noeud, Mozilla donne une erreur "Attribut déjà utilisé" NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR, car le DOM nécessite que le clonage d'`Attr` soit réutilisé (contrairement aux autres Noeuds qui peuvent être déplacés).
-<p>{{ DOMAttributeMethods() }}</p>
+{{ DOMAttributeMethods() }}
-<h2 id="Sp.C3.A9cification">Spécification</h2>
+## Spécification
-<ul>
- <li><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAtNodeNS">DOM Level 2 Core: setAttributeNodeNS (en)</a> <small>— <a href="http://www.yoyodesign.org/doc/w3c/dom2-core/core.html#ID-ElSetAtNodeNS">traduction en français</a> (non normative)</small></li>
-</ul>
+- [DOM Level 2 Core: setAttributeNodeNS (en)](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAtNodeNS) — [traduction en français](http://www.yoyodesign.org/doc/w3c/dom2-core/core.html#ID-ElSetAtNodeNS) (non normative)