HTML DOM Superscript Object Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report 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 HTML <!DOCTYPE html> <html> <head> <title> HTML DOM superscript Object </title> </head> <body style="text-align:center"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM superscript Object</h2> <p>A<sup id="sup_scr">computer science</sup> portal for geeks.</p> <button onclick="Geeks()">Click Here</button> <!-- script to set style in superscript object --> <script> function Geeks() { let txt = document.getElementById("sup_scr"); txt.style.color = "green"; } </script> </body> </html> Output: Example 2: Superscript Object can be created by using the document.createElement method. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM superscript Object </title> </head> <body style="text-align:center"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM superscript 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("SUP"); 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 accessKey Property The DOM accessKey property is used to set or return the accesskey attribute of an element. Syntax : For Set the accessKey :HTMLElementObject.accessKey = valueFor Return the accessKey :HTMLElementObject.accessKey Value: character: A character that is used to specify the shortcut key. Return Value: Th 2 min read HTML DOM Small Object The Small Object in HTML DOM is used to represent the HTML <small> element. The small element can be accessed by using the getElementById() method. Syntax: document.getElementById("id"); Where id is assigned to the <small> tag. Example 1: In this example, we will see the use of Small Obj 1 min read 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 Like