Create a comment node, and insert it to the HTML document:
The result will be:
The createComment() method creates a Comment node with the specified text.
Method | |||||
---|---|---|---|---|---|
createComment() | Yes | Yes | Yes | Yes | Yes |
Parameter | Type | Description |
---|---|---|
text | String | Optional. The text you want to be your comment, in the Comment object |
Return Value: | A Comment Object, representing the created Comment node |
---|---|
DOM Version | Core Level 1 Document Object |