HTML DOM Ol Object

Ol Object The Ol object represents an HTML <ol> element. Access an Ol Object You can access an <ol> element by using getElementById(): Example var x = document.getElementById(“myOl”); Try it Yourself » Create an Ol Object You can create an <ol> element by using the document.createElement() method: Example var x = document.createElement(“OL”); Try it Yourself » Ol […]

HTML <ol> Attributes

HTML <ol> compact Attribute Use of the compact attribute in an ordered HTML list: <ol compact> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> Try it Yourself » Definition and Usage The compact attribute is a boolean attribute. When present, it specifies that the list should render smaller than normal, by reducing the space between lines and the indentation of the list. […]

HTML <ol> Tag

Example 2 different ordered lists: <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol><ol start=”50″> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> Try it Yourself » Definition and Usage The <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical. Use the <li> tag to define list items. Browser Support Element <ol> Yes Yes Yes Yes Yes Tips and Notes Tip: For […]