/

HTML / CSS / JavaScript Tutorial

JavaScript Document own method: createComment()

[this page | pdf | back links]

The createComment() method (when applied to the document object of the JavaScript DOM) creates a comment node.

 

It has the following syntax with the following parameters. It returns a comment object.

 

document.createComment(text)

 

Parameter

Required / Optional

Description

text

Optional

The text to include in the comment object

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile