HTML | DOM Ul Object Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Ul Object is used to represent the HTML <ul> element .the ul element is accessed by getElementById().Properties: compact: It is used to set or return whether the height of the unordered list would be render smaller than normal, or not. type: It is used to set or return the value of the type attribute of an <ul> element. Syntax: document.getElementById("ID"); Where “id” is the ID assigned to the “ul” tag.Example-1: html <!DOCTYPE html> <html> <head> <title>DOM ul Object</title> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM ul Object </h2> <ul id="Geeks"> <!-- Assigning id to 'li tag' --> <li id="GFG">Geeks</li> <li>Sudo</li> <li>Gfg</li> <li>Gate</li> <li>Placement</li> </ul> <button onclick="myGeeks()">Submit</button> <p id="sudo"></p> <script> function myGeeks() { // Accessing 'ul' tag. var g = document.getElementById( "Geeks").id; document.getElementById( "sudo").innerHTML = g; } </script> </body> </html> Output:Before Clicking On Button : After Clicking On Button : Example-2 : <ul> Object can be created by using the document.createElement method. html <!DOCTYPE html> <html> <head> <title>DOM ul Object</title> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM ul Object </h2> <button onclick="myGeeks()">Submit</button> <script> function myGeeks() { // 'ul' tag Created. var g = document.createElement("UL"); g.setAttribute("id", "GFG"); document.body.appendChild(g); var f = document.createElement("LI"); var w = document.createTextNode("Geeks"); f.appendChild(w); document.getElementById("GFG").appendChild(f); var x = document.createElement("LI"); var y = document.createTextNode("Sudo"); x.appendChild(y); document.getElementById("GFG").appendChild(x); } </script> </body> </html> Output:Before Clicking On Button: After Clicking On Button: Supported Browsers: The browsers supported by DOM Ul Object are listed below: Google ChromeInternet ExplorerFirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML | DOM Style backgroundSize Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Style columnCount Property The DOM Style columnCount property specifies a number that defines the number of columns an element should be divided into. Syntax : To return the value: object.style.columnCount To set the value: object.style.columnCount = "number|auto|initial|inherit" Property Values: number: Specifies the number 4 min read HTML | DOM Style backgroundSize Property The HTML DOM Style backgroundSize Property is used to set or return the size of the background image. Syntax: To get the backgroundSize propertyobject.style.backgroundSizeTo set the backgroundSize propertyobject.style.backgroundSize = "auto | length | percentage | cover| contain |initial | inherit" 6 min read HTML | DOM Style font Property The HTML DOM Style's font property is used to change the element's font properties. It can be used to change the font style, weight, size, and family. Syntax: To set the font style :node.style.font = "font-properties font-size font-family;"To get the current font style:node.style.font; Return Values 2 min read HTML | DOM Style lineHeight Property The Style lineHeight property is used for setting or returning the distance between lines in a text. It is a string which represents the distance between lines in the text. To return the line-height.object.style.lineHeightTo set the line-height.object.style.lineHeight = "normal|number|length|%|initi 2 min read HTML DOM Style maxWidth Property The maxWidth property of HTML DOM sets/returns the maximum width of an element. The maxWidth property affects only block-level elements, absolute or fixed position elements. Syntax: It returns the maxWidth property.object.style.maxWidthIt sets the maxWidth Property.object.style.maxWidth = "none | le 2 min read HTML | DOM AnimationEvent In the HTML document, AnimationEvent interface is used to represent events providing information related to animations. AnimationEvent contains properties such as animationName, elapsedTime and pseudoElement. animationName: The animationName property returns the name of the event animation. It retur 2 min read HTML | DOM Style animationFillMode Property The DOM style animationFillMode property is used to specify the style of an element when the animation is not playing or when an animation is finished or when there is a delay in animation. The animationFillMode property can override the default behavior of CSS animations by which CSS animations aff 3 min read HTML DOM ownerDocument Property The ownerDocument property returns the top-level document object of the node. Here, the owner document of the node is returned as the document object. It is a read-only property. Syntax: node.ownerDocument; Properties: nodeName property: It returns the name of the specified node. If the node is an e 2 min read HTML | DOM Style transitionDelay Property The transitionDelay property in HTML DOM is used to specify the time in seconds or milliseconds when execution of transition starts. The delay refers to the time, which to be waited before starting the transition effect. Syntax: It returns the transitionDelay property.object.style.transitionDelayIt 3 min read HTML DOM Style textDecorationStyle Property The Style textDecorationStyle property in HTML DOM is used to set the decoration of text with different kinds of lines. It can display the line in various styles like a single line, double line, wavy, etc. By using this property, we can display the line in a specified style. Syntax:Â Â It returns the 2 min read Like