HTML DOM head Property Last Updated : 02 Sep, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 below program illustrates the document.head property in HTML. HTML <!DOCTYPE html> <html> <head id="Article Head"> <title> DOM document.head() Property in HTML </title> <style> h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM document.head Property</h2> <p> For displaying the Head of the document, double click the "View Head" button: </p> <button ondblclick="myHead()"> View Head </button> <p id="head"></p> <script> function myHead() { let gfg = document.head.id; document.getElementById("head").innerHTML = gfg; } </script> </body> </html> Output: Supported Browsers: The browsers supported by DOM head property are listed below: Google ChromeEdge FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM console error() Method S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM writeln() Method The writeln() method is used to write a document with the additional property of a newline character after each statement. This method is similar to the document.write() method. Syntax: document.writeln( exp1, exp2, exp3, ... )Parameters: This method contains many parameters which are optional. All 1 min read HTML DOM console error() Method The console.error() method in HTML is used to display an error message on the console. The console.error() method is used for testing purposes. The error message is sent as a parameter to the console.error() method. Syntax:console.error( message )Parameters: This method accepts a single parameter me 2 min read HTML DOM console groupCollapsed() Method The console.groupCollapsed() method in HTML is used to create a collapsed group of messages in the console. It indicates the start of a collapsed message group and all the messages written after calling the console.groupCollapsed() method will write inside the message group. The label is sent as an 2 min read HTML DOM console count() Method The console.count() method in HTML is used to write the number of times the console.count() method is called. The console.count() method can be added to a label that will be included in the console view. The label is an optional parameter sent to the console.count() method. Syntax:console.count( lab 2 min read HTML DOM console clear() Method The console.clear() method in HTML is used to clear the console and writes some message "Console was cleared" on the console whenever it is executed. This method does not require any parameter. Syntax:console.clear()Example: The below program illustrates the console.clear() method in HTML:HTML<!D 2 min read 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 Like