diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:24 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
| commit | 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch) | |
| tree | 30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/document/createtextnode | |
| parent | c05efa8d7ae464235cf83d7c0956e42dc6974103 (diff) | |
| download | translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2 translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/api/document/createtextnode')
| -rw-r--r-- | files/fr/web/api/document/createtextnode/index.md | 80 |
1 files changed, 31 insertions, 49 deletions
diff --git a/files/fr/web/api/document/createtextnode/index.md b/files/fr/web/api/document/createtextnode/index.md index 7fc4bfe701..805d83081f 100644 --- a/files/fr/web/api/document/createtextnode/index.md +++ b/files/fr/web/api/document/createtextnode/index.md @@ -8,71 +8,53 @@ tags: - Reference translation_of: Web/API/Document/createTextNode --- -<p>{{APIRef("DOM")}}</p> +{{APIRef("DOM")}} -<p>Crée un nouveau nœud de texte.</p> +Crée un nouveau nœud de texte. -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox"><var>var text</var> = document.createTextNode(<var>données</var>); -</pre> + var text = document.createTextNode(données); -<ul> - <li><code>texte</code> est un nœud de texte.</li> - <li><code>donnees</code> est une chaîne contenant les données à placer dans le nœud de texte.</li> -</ul> +- `texte` est un nœud de texte. +- `donnees` est une chaîne contenant les données à placer dans le nœud de texte. -<h2 id="Exemple">Exemple</h2> +## Exemple -<pre class="brush: html"><!DOCTYPE html> -<html lang="en"> -<head> -<title>createTextNode example</title> -<script> +```html +<!DOCTYPE html> +<html lang="en"> +<head> +<title>createTextNode example</title> +<script> function addTextNode(text) { var newtext = document.createTextNode(text), p1 = document.getElementById("p1"); p1.appendChild(newtext); } -</script> -</head> +</script> +</head> -<body> - <button onclick="addTextNode('YES! ');">YES!</button> - <button onclick="addTextNode('NO! ');">NO!</button> - <button onclick="addTextNode('WE CAN! ');">WE CAN!</button> +<body> + <button onclick="addTextNode('YES! ');">YES!</button> + <button onclick="addTextNode('NO! ');">NO!</button> + <button onclick="addTextNode('WE CAN! ');">WE CAN!</button> - <hr /> + <hr /> - <p id="p1">First line of paragraph.</p> -</body> -</html></pre> + <p id="p1">First line of paragraph.</p> +</body> +</html> +``` -<h2 id="Sp.C3.A9cification">Spécifications</h2> +## Spécifications -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Spécification</th> - <th scope="col">Statut</th> - <th scope="col">Commentaire</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName("DOM3 Core", "core.html#ID-1975348127", "Document.createTextNode()")}}</td> - <td>{{Spec2("DOM3 Core")}}</td> - <td>Pas de changement</td> - </tr> - <tr> - <td>{{SpecName("DOM2 Core", "core.html#ID-1975348127", "Document.createTextNode()")}}</td> - <td>{{Spec2("DOM2 Core")}}</td> - <td>Définition initiale</td> - </tr> - </tbody> -</table> +| Spécification | Statut | Commentaire | +| ------------------------------------------------------------------------------------------------------------ | ---------------------------- | ------------------- | +| {{SpecName("DOM3 Core", "core.html#ID-1975348127", "Document.createTextNode()")}} | {{Spec2("DOM3 Core")}} | Pas de changement | +| {{SpecName("DOM2 Core", "core.html#ID-1975348127", "Document.createTextNode()")}} | {{Spec2("DOM2 Core")}} | Définition initiale | -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> +## Compatibilité des navigateurs -<p>{{Compat("api.Document.createTextNode")}}</p> +{{Compat("api.Document.createTextNode")}} |
