THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Ol type Property

Ol Object Reference Ol Object

Example

Set the ordered list to use lowercase alphabetical letters:

document.getElementById("myOl").type = "a";
Try it yourself »

Definition and Usage

The type property 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

Internet Explorer Firefox Opera Google Chrome Safari

The type property is supported in all major browsers.


Syntax

Return the type property:

olObject.type

Set the type property:

olObject.type="1|a|A|i|I"

Property Values

Value Description
1 Default. Decimal numbers (1, 2, 3, 4)
a Alphabetically ordered list, lowercase (a, b, c, d)
A Alphabetically ordered list, uppercase (A, B, C, D)
i Roman numbers, lowercase (i, ii, iii, iv)
I Roman numbers, 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;

The result of x will be:

I
Try it yourself »

Example

Set the ordered list to use uppercase alphabetical letters:

document.getElementById("myOl").type = "A";
Try it yourself »

Example

Set the ordered list to use lowercase roman numbers:

document.getElementById("myOl").type = "i";
Try it yourself »

Example

Set the ordered list to use uppercase roman numbers:

document.getElementById("myOl").type = "I";
Try it yourself »

Related Pages

HTML reference: HTML <ol> type attribute


Ol Object Reference Ol Object