HTML DOM Subscript Object Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report 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 Object. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM subscript Object </title> </head> <body style="text-align:center"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM subscript Object</h2> <p> A<sub id="sub_scr">computer science</sub> portal for geeks. </p> <button onclick="Geeks()"> Click Here </button> <!-- script to set style to subscript object --> <script> function Geeks() { let txt = document.getElementById("sub_scr"); txt.style.color = "green"; } </script> </body> </html> Output: Example 2: Subscript Object can be created by using the document.createElement method. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM subscript Object </title> </head> <body> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM subscript Object</h2> <button onclick="Geeks()"> Click Here! </button> <br><br> <div> A <span id="p"></span> portal for geeks. </div> <script> function Geeks() { let txt = document.createElement("SUB"); let t = document.createTextNode("computer science"); txt.appendChild(t); document.getElementById("p").appendChild(txt); } </script> </body> </html> Output: Supported Browsers: OperaInternet ExplorerGoogle ChromeFirefoxApple Safari Comment More infoAdvertise with us V Vishal Chaudhary 2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM Mark Object The Mark Object in HTML DOM is used to represent the HTML <mark> element. The Mark Object is new in HTML 5. The <mark> element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the <mark> tag. Note: This tag is not s 1 min read HTML DOM Textarea select() Method The select() method in HTML DOM is used to select the entire content of the text area or in a <input> element that includes a text field. Syntax: textareaObject.select() Parameters: This method does not accept any parameters. Return Value: It does not return any value. Example: In this example 1 min read HTML DOM removeChild() Method The HTML DOM removeChild() method is used to remove a specified child node of the given element. It returns the removed node as a node object or null if the node doesn't exist. Syntax: node.removeChild(child) Parameters: This method accepts a single parameter child which is mandatory. It represents 2 min read HTML DOM S Object The S Object in HTML DOM is used to represent the HTML <s> element. This tag is used to specify that the text content is no longer correct or accurate. The <s> element can be accessed by using the getElementById() method. Syntax: document.getElementById("id"); Where id is assigned to the 1 min read 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 Like