Met Document Createcomment
# HTML DOM createComment() Method
[ Document Object](#)
## Example
Can create a comment node and insert it into the HTML document:
var c=document.createComment("My personal comments");
document.body.appendChild(c);
Output:
[Try it Β»](#)
* * *
## Definition and Usage
The createComment() method creates a Comment node.
* * *
## Browser Support

The createComment() method is supported by all major browsers.
* * *
## Syntax
document.createComment(_text_)
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| _text_ | String | Optional. The text for the comment. |
## Return Value
| Type | Description |
| --- | --- |
| Comment object | The created Comment node |
## Technical Details
| DOM Version | Core Level 1 Document Object |
| --- |
* * Document Object](#)
YouTip