HTML DOM Samp Object Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The Samp Object in HTML DOM is used to represent the <samp> element. The <samp> element can be accessed by using the getElementById() method. Syntax: document.getElementById("ID"); Where ID is assigned to the <samp> tag. Example 1: In this example, we will use the DOM Samp Object. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM samp Object </title> </head> <body> <h1> GeeksforGeeks </h1> <h2> HTML DOM Samp Object </h2> <samp id="geeks"> A computer science portal for Geeks </samp> <br><br> <button onclick="myGeeks()"> Submit </button> <script> function myGeeks() { let txt = document.getElementById("geeks"); txt.style.color = "green"; txt.style.fontSize = "16px"; } </script> </body> </html> Output: Example 2: Samp Object can be created by using the document.createElement Method. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM samp Object </title> </head> <body> <h1>GeeksForGeeks</h1> <h2>DOM Samp Object</h2> <button onclick="myGeeks()"> Submit </button><br> <script> function myGeeks() { let cont = document.createElement("SAMP"); let txt = document.createTextNode( "A Computer SciencePortalForgeeks"); cont.appendChild(txt); document.body.appendChild(cont); } </script> </body> </html> Output: Supported Browsers: The browser supported by DOM Samp Object are listed below: Google ChromeInternet ExplorerFirefoxOperaSafari Comment More infoAdvertise with us M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML Web technologies HTML-DOM +1 More Practice Tags : Misc Similar Reads HTML DOM createDocumentFragment() Method The createDocumentFragment() method in HTML DOM is used to create the document fragment which is useful for changing the content of the document such as deleting, modifying, or adding a new node. This method creates the document fragment, then appends the elements of the document to the document fra 2 min read HTML | DOM Location origin Property The DOM Location origin Property in HTML is used to return the protocol, hostname and port number of a URL. This is a read-only property. Syntax: location.origin Return Value: This method returns a String value representing the protocol, the domain name (or IP address) and port number. The URL's hav 1 min read HTML | DOM Style fontSize Property The fontSize property is used to set or get the font size of characters in a word should appear. Syntax: It returns the fontSize property.object.style.fontSizeIt sets the fontSize Property.object.style.fontSize = "value|initial|inherit" Property Values: ValueDescriptionxx-small x-small small medium 2 min read HTML | DOM Style marginLeft Property The DOM Style marginLeft property is used to set or get the left margin of an element. The margin is used to insert space around the border, unlike padding that is used to insert space within the border of an element. Syntax: To Set the marginLeft:object.style.marginLeft='%|length|auto|initial|inher 2 min read HTML DOM MouseEvent The MouseEvent Object handles events that occur when the mouse interacts with the HTML document. There are lots of events that interacts with the HTML document. Mouse Events: Mouse events are the action taken by the user on the web page, like clicking, hovering over, etc. Mouse Events Description on 3 min read HTML DOM Style fontWeight Property The fontWeight style property in HTML DOM is used to set or return the thickness of characters in a word that should appear. Syntax: It returns the fontWeight property.object.style.fontWeightIt sets the fontWeight Property.object.style.fontWeight = "normal | lighter | bold | bolder | value | initial 2 min read HTML | DOM Pre Object The DOM Pre Object is used to represent the HTML <pre> element. The pre element is accessed by getElementById().Properties: width: It is used to set or return the value of the width attribute of the pre element. Syntax: document.getElementById("ID"); Where âidâ is the ID assigned to the âpreâ 1 min read HTML | DOM Ol Object The DOM Ol Object is used to represent the HTML <ol> element . The ol element is accessed by getElementById(). To read more about lists check HTML | Lists. Properties: compact: It is used to set or return whether the size of the list would be displayed normal or not.reversed: It is used to set 2 min read HTML | DOM Style letterSpacing Property The Style letterSpacing property in HTML DOM is used to set the space between the characters. This property allows to set the required space between characters and also used to returns the space between characters. Syntax: It returns the letterSpacing property.object.style.letterSpacingIt used to se 2 min read HTML DOM Style minHeight Property The minHeight property in HTML DOM is used to set or return the minimum height of an element. This property affects only on block-level elements, absolute or fixed position elements. Syntax: It returns the minHeight property.object.style.minHeightIt is used to set the minHeight Property.object.style 2 min read Like