Comment()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since octobre 2017.
Expérimental: Il s'agit d'une technologie expérimentale.
Vérifiez attentivement le tableau de compatibilité des navigateurs avant de l'utiliser en production.
Le constructeur Comment()
renvoie un objet Comment
(Commentaire) nouvellement créé avec le DOMString
donné en paramètre comme contenu textuel.
Syntaxe
js
comment1 = new Comment(); // Create an empty comment
comment2 = new Comment("This is a comment");
Exemple
js
var comment = new Comment("Test");
Spécifications
Specification |
---|
DOM> # ref-for-dom-comment-comment①> |
Compatibilité des navigateurs
Loading…