
- 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 type Property
The HTML DOM Ol type property sets/returns the value of the type attribute which corresponds to the type of marker used in an ordered list.
Following is the syntax −
Returning type property
olObject.type
Setting type to a character
olObject.type = ‘1|a|A|i|I’
Let us see an example of Ol type property −
Example
<!DOCTYPE html> <html> <head> <title>HTML DOM Ol type</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-type</legend> <h3>Students</h3> <ol id="orderList" type='2'> <li>Adam</li> <li>Alex</li> <li>Bina</li> <li>Eden</li> <li>Rajesh</li> <li>Zampa</li> </ol> <input type="button" onclick="changeMarker()" value="Change Marker"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var studentList = document.getElementById("orderList"); function changeMarker() { studentList.type = 'I'; divDisplay.textContent = 'Marker Changed'; } </script> </body> </html>
Output
Before clicking ‘Change Marker’ button −
After clicking ‘Change Marker’ button −
- Related Articles
- HTML DOM Ol reversed Property
- HTML DOM Ol start Property
- HTML DOM Ol Object
- HTML DOM Event type Property
- HTML DOM Object type Property
- HTML DOM Anchor type Property
- HTML DOM Button type Property
- HTML DOM Select type Property
- HTML DOM Link type Property
- HTML DOM Fieldset type property
- HTML DOM Input Button type Property
- HTML DOM Input FileUpload type Property
- HTML DOM Input Hidden type Property
- HTML DOM Input Month type Property
- HTML DOM Input Password type property

Advertisements