Ol typeProperties
Examples
Set an ordered list with lowercase letters:
document.getElementById("myOl").type="a";
Try it Yourself »
Definition and Usage
The type attribute sets or returns the value of the type attribute of an ordered list.
The type attribute specifies the kind of marker to use in the list (letters or numbers).
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the type attribute.
Syntax
Return the type attribute:
olObject.type
Set the type attribute:
olObject.type="1|a|A|i|I"
Property Values
| Value | Description |
|---|---|
| 1 | Default. Decimal numbers (1, 2, 3, 4) |
| a | Alphabetical ordered list, lowercase (a, b, c, d) |
| A | Alphabetical ordered list, uppercase (A, B, C, D) |
| i | Roman numerals, lowercase (i, ii, iii, iv) |
| I | Roman numerals, uppercase (I, II, III, IV) |
Technical Details
| Return value: | A string, representing the kind of marker used in the ordered list. |
|---|
More Examples
Example
Return the kind of marker used in an ordered list:
var x = document.getElementById("myOl").type;
xOutput:
I
Try it Yourself »
Example
Set an ordered list with uppercase letters:
document.getElementById("myOl").type="A";
Try it Yourself »
Example
Set an ordered list with lowercase Roman numerals:
document.getElementById("myOl").type="i";
Try it Yourself »
Example
Set an ordered list with uppercase Roman numerals:
document.getElementById("myOl").type="I";
Try it Yourself »
Related Articles
HTML Reference Manual:HTML <ol> type Attribute
Other extensions
Ol Object