From 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:24 +0200 Subject: convert content to md --- files/fr/web/api/document/createcomment/index.md | 31 +++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'files/fr/web/api/document/createcomment') diff --git a/files/fr/web/api/document/createcomment/index.md b/files/fr/web/api/document/createcomment/index.md index 5e16be2ecb..d2553c1327 100644 --- a/files/fr/web/api/document/createcomment/index.md +++ b/files/fr/web/api/document/createcomment/index.md @@ -8,34 +8,31 @@ tags: - Reference translation_of: Web/API/Document/createComment --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

createComment() crée et retourne un nouveau noeud de type commentaire.

+`createComment()` crée et retourne un nouveau noeud de type commentaire. -

Syntaxe

+## Syntaxe -
CommentNode = document.createComment(data)
-
+ CommentNode = document.createComment(data) -

Paramètres

+### Paramètres -
-
data
-
Une chaîne de caractères représentant le contenu du commentaire.
-
+- `data` + - : Une chaîne de caractères représentant le contenu du commentaire. -

Exemple

+## Exemple -
var docu = new DOMParser().parseFromString('<xml></xml>',  "application/xml");
+```js
+var docu = new DOMParser().parseFromString('',  "application/xml");
 var comment = docu.createComment('Voici un commentaire pas très bien caché');
 
 docu.getElementsByTagName('xml')[0].appendChild(comment);
 
 alert(new XMLSerializer().serializeToString(docu));
-// Affiche: <xml><!--Voici un commentaire pas très bien caché--></xml>
+// Affiche: +``` -

Spécification

+## Spécification - +- [createComment](http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-createComment) -- cgit v1.2.3-54-g00ecf