HTML DOM createComment() Method Last Updated : 02 Sep, 2024 Comments Improve Suggest changes Like Article Like Report The createComment() method is used to create a comment node with some specified text. This property is used to set a text value as a parameter that is of string type. Syntax:document.createComment( text )Parameters: This method accepts single parameter text which is optional. This parameter is used to hold the comment string. Example: In this example, we will use createComment() method html <!DOCTYPE html> <html> <head> <title>DOM createComment() Method</title> <style> h1, h2 { color: green; font-weight: bold; } </style> </head> <body> <h1>GeeksForGeeks</h1> <h2>DOM createComment() Method</h2> <button onclick="geeks()"> Submit </button> <p id="sudo"></p> <script> function geeks() { let c = document.createComment("GFG comments"); document.body.appendChild(c); let x = document.getElementById("sudo"); x.innerHTML = "Comments are Invisible!"; } </script> </body> </html> Output:Supported Browsers: The browser supported by DOM createComment() Method properties are listed below:Google ChromeEdge FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM createComment() Method M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML DOM createTextNode() Method The createTextNode() method is used to create a TextNode which contains an element node and a text node. It is used to provide text to an element. This method contains the text values as parameters which are of string type.Syntax: document.createTextNode( text )Parameters: This method accepts single 2 min read HTML DOM console table() Method The console.table() method in HTML is used for writing data in tabular form in the console view. The table data is sent as a parameter to the console.table() method which must be an object or an array containing the data to be filled in the table. Syntax:console.table( tabledata, tablecolumns );Para 3 min read HTML DOM appendChild() Method The HTML DOM appendChild() method adds a new child node to the end of a specified parent node's child list. It can move existing nodes or add new nodes, allowing dynamic updates to the document structure by appending elements, text, or other nodes.Syntax:node.appendChild(node);Parameters: This metho 3 min read HTML DOM images Collection Property The images collection property in HTML is used to return the collection of <img> elements in the document. It can be used for knowing the count of images inserted in the document using the <img> tag. The <input> elements with type = image are not counted in the image property.Synta 4 min read HTML DOM console group() Method The console.group() method in HTML is used to create a group of messages in the console. It indicates the start of a message group and all the messages written after calling the console.group() method will write inside the message group. The label is sent as an optional parameter to the console.grou 2 min read HTML DOM console.assert( ) Method The console.assert() method in HTML is used to write a message for the user on the console only if the expression evaluates to false. The expression and the message are sent as parameters to the console.assert() method. Syntax:console.assert( expression, message )Parameters: This method accepts two 2 min read HTML DOM console.info() Method The console.info() method in HTML is used for writing a message in the console. It indicates an important message about any element or object. The message is sent as a parameter to the console.info() method.Syntax:  console.info( message )Parameters: This method accepts a single parameter message wh 2 min read HTML DOM URL Property The DOM URL property in HTML is used to return a string that contains the complete URL of the current document. The string also includes the HTTP protocol such as ( http://).Syntax:document.URLReturn Value: It returns a string value that represents the full URL of the document. Example: In this exam 2 min read HTML DOM head Property The head property in HTML is used to return the first occurrence of the head if multiple heads in the document. It returns the reference of the head object, which represents the <head> elementSyntax: document.headReturn value: It returns the <head> element of the head object.Example: The 2 min read HTML DOM embeds Collection The DOM embeds collection property in HTML is used to return the collection of all embedded elements. The elements in the collection are sorted that appear in the source code. This property is used for read-only. Syntax: document.embedsProperty: This property contains a value length that returns the 3 min read Like