HTML DOM Nav Object Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM nav object is used to represent the HTML <nav> element. The<nav> element is accessed by getElementById(). Syntax: document.getElementById("id") Where id is assigned to the <nav> tag. Note: The Nav Object is not supported by Internet Explorer 8 and earlier versions. Example 1: In this example, we will see the use of the DOM Nav Object. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Nav Object </title> </head> <body> <h1> GeeksforGeeks </h1> <h2>HTML DOM nav Object</h2> <nav id="nav_object"> <a href="#">Data Structure</a> | <a href="#">Algorithm</a> | <a href="#">Programming Languages</a> </nav> <br> <button onclick="Geeks()"> Click Here! </button> <p id="sudo"></p> <script> function Geeks() { let obj = document.getElementById("nav_object").innerHTML; document.getElementById("sudo").innerHTML = obj; } </script> </body> </html> Output: Example 2: Nav Object can be created by using the document.createElement method. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM nav Object </title> </head> <body> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM nav Object</h2> <button onclick="Geeks()"> Click Here! </button> <br><br> <script> function Geeks() { let ele = document.createElement("NAV"); document.body.appendChild(ele); let a = document.createElement("A"); a.setAttribute("href", "/html"); let txt = document.createTextNode("Home"); a.appendChild(txt); ele.appendChild(a); } </script> </body> </html> Output: Supported Browsers: Google ChromeEdgeMozilla FirefoxOperaSafari Comment More infoAdvertise with us V Vishal Chaudhary 2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM Style direction Property The Style direction property in HTML DOM is used to set or return the text direction of an element. Syntax: It is used to set the text direction.object.style.direction = "ltr|rtl|initial|inherit"It returns the text direction.object.style.direction Property Values: ltr: Specifies the direction as lef 2 min read HTML DOM Strong Object The Strong Object in HTML DOM is used to represent the HTML <strong> element. This tag is used to show the importance of the text. The strong element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the <strong> tag. Exam 2 min read HTML DOM Underline Object The DOM underline object is used to represent the HTML <u> element. The underline element is accessed by getElementById(). Syntax: document.getElementById("id"); Where 'id' is the ID assigned to the <u> tag. Example 1: In this example, we will use the DOM underline object. HTML <!DOCT 1 min read HTML DOM Kbd Object The Kbd Object in HTML DOM is used to represent the HTML <kbd> element. The <kbd> tag is the phrase tag and is used to define the keyboard input. The text enclosed by the <kbd> tag is typically displayed in the browserâs default monospace font. The <kbd> element can be access 2 min read HTML DOM Italic Object The Italic Object in HTML DOM is used to represent the HTML <i> element. This tag is used to display the content in italic style. The <i> element can be accessed by using the getElementById() method. Syntax: document.getElementById("id"); Where id is assigned to the <i> tag. Exampl 1 min read HTML DOM HashChangeEvent The HashChangeEvent in HTML DOM is an interface between the events that are triggered when the hash of the URL has been changed. The anchor part of the URL follows the # symbol. Supported Tags <body> Properties/Methods: newURL: This property is used to return the URL of the document after the 2 min read HTML DOM removeAttributeNode() Method The DOM removeAttributeNode() method is used to remove the specified attribute from the current element. It is similar to removeAttribute() method but the difference is that the removeAttribute method is used to remove the attribute with the specified name, but on the other hand removeAttributeNode 1 min read HTML DOM Superscript Object The superscript object in HTML DOM is used to represent the HTML <sup> element. The superscript element can be accessed by using getElementById(). Syntax: document.getElementById("id") Where id is assigned to the <sup> tag. Example: In this example, we will use DOM Superscript Object HTM 1 min read HTML DOM replaceChild() Method The replaceChild() method in HTML DOM is used to replace a child node with a new node within the given parent node. Syntax: parentNode.replaceChild( newChild, oldChild ) Parameter Values: This method accepts two parameters which are listed below: newChild: It is the required parameter. It represents 1 min read HTML DOM Subscript Object The Subscript Object in HTML DOM is used to represent the HTML <sub> element. The subscript element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the <sub> tag. Example 1: In this example, we will use DOM Subscript Obj 1 min read Like