HTML DOM li Object Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The DOM Li Object is used to represent the HTML <li> element. The li element is accessed by getElementById(). Properties: value: It has an attribute named value which is used to return the value of the value attribute of the <li> tag. Syntax: document.getElementById("ID"); Where “id” is the ID assigned to the “li” tag. Example 1: In this example, we will see the use of DOM Li Object. html <!DOCTYPE html> <html> <head> <title>DOM li Object</title> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM Li Object </h2> <ol> <!-- Assigning id to 'li tag' --> <li id="GFG">Geeks</li> <li>Sudo</li> <li>Gfg</li> <li>Gate</li> <li>Placement</li> </ol> <button onclick="myGeeks()">Submit</button> <script> function myGeeks() { // Accessing 'li' tag. let g = document.getElementById("GFG"); g.value = "100"; } </script> </body> </html> Output: Example 2: <li> Object can be created by using the document.createElement method. HTML <!DOCTYPE html> <html> <head> <title>DOM li Object</title> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM Li Object </h2> <ol ID="GFG"> <li>Geeks</li> <li>Sudo</li> <li>Gfg</li> <li>Gate</li> </ol> <button onclick="myGeeks()">Submit</button> <script> function myGeeks() { // li tag created. let G = document.createElement("LI"); let F = document.createTextNode("Placement"); G.appendChild(F); document.getElementById("GFG").appendChild(G); } </script> </body> </html> Output: Supported Browsers: The browser supported by DOM Li Object are listed below: Google ChromeInternet ExplorerFirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML | DOM Style justifyContent Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML Web technologies HTML-DOM +1 More Practice Tags : Misc Similar Reads HTML | DOM Style justifyContent Property The style justifyContent property in HTML DOM is used to align the items horizontally when they are not able to use all the available space. It is used to set the position of the element. By default, the items are positioned at the beginning of the container. Syntax: It returns the justifyContent pr 3 min read HTML DOM Samp Object 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. 1 min read HTML DOM OptionGroup Object The HTML DOM OptionGroup object represents the <optgroup> element, used to group related options within a dropdown list (<select>). It helps organize options with a label for better user experience in forms. Property Values: This object contains two property values which are listed below 2 min read HTML DOM execCommand() Method The DOM execCommand() method in HTML DOM is used to execute a command specified by the user on the editable selected section. Syntax:document.execCommand( command, showUI, value )Parameters: This method accepts three parameters which are listed below:command: This parameter hold the name of command 3 min read HTML | DOM Style left Property The Style left property is used for setting or returning the left position of a positioned element. The Style left property is used for specifying the left position of the elements including padding, scrollbar, border, and margin. Syntax : To get the property:object.style.leftTo set the propertyobje 2 min read HTML | DOM Quote Object The Quote Object in HTML DOM is used to represent the HTML <q> element. The quote element can be accessed by using getElementById() method.Property Value: It contains single attribute value cite. This attribute is used to set or return the value of the cite attribute in a <q> element.Syn 2 min read HTML | DOM Progress Object The Progress Object in HTML DOM is used to represent the HTML <progress> element. The <progress> element can be accessed by using getElementById() method.Property Values: labels: It returns the list of progress bar labels.max: It is used to set or return the progress bar value of the max 2 min read HTML | DOM Style alignItems Property The DOM Style alignItems Property is used to set or return the default alignment of items in a flexible container. Syntax: To get the alignItems Propertyobject.style.alignItemsTo set the alignItems Propertyobject.style.alignItems = "stretch|center|flex-start|flex-end| baseline|initial|inherit" Prope 5 min read HTML| DOM Ins Object The DOM ins Object is used to represent the HTML <ins> element. The ins element is accessed using getElementById().Properties: cite: It is used to set or return the value of the cite attribute of a inserted element.dateTime: It is used to sets or returns the value of the dateTime attribute of 2 min read HTML | DOM Style emptyCells Property Sometimes HTML tables contain empty cells. The DOM Style emptyCells is used to display borders and background for the empty cells. Syntax: It is used to return the emptyCells property.object.style.emptyCellsIt is used to set emptyCells property.object.style.emptyCells = "show|hide|initial|inherit" R 2 min read Like