HTML DOM Location hostname Property Last Updated : 04 Jan, 2023 Comments Improve Suggest changes Like Article Like Report The Location hostname property in HTML is used to return the hostname of the current URL. The Location hostname property returns a string that contains the domain name, or the IP address of a URL. Syntax: It returns the hostname property. location.hostname It is used to set the hostname property. location.hostname = hostname The below program illustrates the Location hostname property in HTML: Example: html <h1 style="color:green"> GeeksforGeeks </h1> <h2>DOM Location hostname Property</h2> <p> For returning the hostname of the current URL, double click the "Return hostname" button: </p> <button ondblclick="myhost()"> Return hostname </button> <p id="hostname"></p> <script> function myhost() { var h = location.hostname; document.getElementById("hostname").innerHTML = h; } </script> Output: HTML DOM Location hostname Property Supported Browsers: The browser supported by Location hostname property are listed below: Google Chrome 1Edge 12Internet Explorer 3Firefox 1Opera 12.1Safari 1 Comment More infoAdvertise with us Next Article HTML DOM History forward() Method S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM createComment() Method 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 2 min read HTML DOM console time() Method The console.time() method in HTML is used to start a timer in the console view. The console.time() method can be used for calculating the time of programs for various testing purposes. The label is sent as a parameter to the console.time() method. Syntax:console.time( label )Parameters: This method 2 min read HTML DOM History forward() Method The History forward() method in HTML is used to load the next URL in the history list. It has the same practical application as the forward button in web browsers. This method will not work if the next page will not exist in the history list. Syntax: history.forwardExample: Below program illustrates 1 min read HTML DOM console log() Method The console.log() method in HTML is used for writing a message in the console. It indicates an important message during the testing of any program. The message is sent as a parameter to the console.log() method. Syntaxconsole.log( message )ParametersParameterDescriptionmessageIt is mandatory and use 2 min read HTML DOM Location hash Property The Location Hash property in HTML is used to return the anchor part of a URL. It can also be used to set the anchor part of the URL. It returns the string which represents the anchor part of a URL including the hash '#' sign. Syntax: It returns the hash property.location.hashIt is used to set the h 2 min read HTML DOM History length Property The History length property in HTML is used to return the count of URLs in the history list of the current browser window. The minimum value returned by this property is 1 because the current page is loaded at the moment whereas the maximum count that can be displayed is 50. Web browsers such as Int 1 min read HTML DOM History back() Method The History back() method in HTML is used to load the previous URL in the history list. It has the same practical application as the back button in our web browsers. This method will not work if the previous page does not exist. This method does not contain any parameter.Syntax: history.back Below p 1 min read HTML DOM History go() Method The History go() method in HTML is used for loading a specific URL from the history list. It is a better alternative to history.back() and history.forward() methods if a number or the URL of the specific page is known and wants to load from your history. Syntax: history.go( number|URL )Parameters: T 2 min read HTML DOM console groupEnd() Method The console.groupEnd() method in HTML is used to indicate the end of a group of messages in the console that has been created using the console.group() method. This method does not accept any parameter. Syntax:console.groupEnd()Example: The below program illustrates the console.groupEnd() method in 2 min read HTML DOM readyState Property The readyState property in HTML is used to return the loading status of the current document. This property is used for read-only. Syntax:document.readyStateReturn Value: It returns a string value which is used to define the status of the current document. The one of five status are listed below:uni 2 min read Like