
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Ol Object
The HTML DOM Ol Object in HTML represents the <ol> element.
Creating a <ol> element
var olObject = document.createElement(“OL”)
Here, “olObject” can have the following properties −
Property | Description |
---|---|
reversed | Itsets/returns whether the order of list should be descending orascending (default) |
start | Itsets/returns the value of the start attribute of an ordered list |
type | Itsets/returns the value of the type attribute of an ordered list |
Let us see an example of Ol start property −
Example
<!DOCTYPE html> <html> <head> <title>HTML DOM Ol start</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ol{ width: 30%; margin: 0 auto; } </style> </head> <body> <form> <fieldset> <legend>HTML-DOM-Ol-start</legend> <h3>Students</h3> <ol id="orderList" start='2'> <li>Zampa</li> <li>Rajesh</li> <li>Eden</li> <li>Bina</li> <li>Alex</li> <li>Adam</li> </ol> <input type="button" onclick="reverseNumbering()" value="Correct list"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var studentList = document.getElementById("orderList"); function reverseNumbering() { studentList.start = '1'; divDisplay.textContent = 'List Corrected'; } </script> </body> </html>
Output
Before clicking ‘Correct List’ button −
After clicking ‘Correct List’ button −
- Related Articles
- HTML DOM Ol reversed Property
- HTML DOM Ol start Property
- HTML DOM Ol type Property
- HTML DOM HTML Object
- HTML DOM Object Object
- HTML DOM Ins Object
- HTML DOM HR Object
- HTML DOM Variable Object
- HTML DOM aside Object
- HTML DOM Abbreviation Object
- HTML DOM Address Object
- HTML DOM Meter Object
- HTML DOM MouseEvent Object
- HTML DOM Nav Object
- HTML DOM Time Object

Advertisements