Ol type attribute

Definition and usage

type Attribute sets or returns the value of the type attribute of the ordered list.

<ol> type attribute Specify the marker type (letter or number) to be used in the list.

See also:

HTML Reference Manual:HTML <ol> Tag

Example

Example 1

Set the ordered list to use lowercase letters:

document.getElementById("myOl").type = "a";

Try it yourself

Example 2

Return the marker type used in the ordered list:

var x = document.getElementById("myOl").type;

Try it yourself

Example 3

Set the ordered list to use uppercase letters:

document.getElementById("myOl").type = "A";

Try it yourself

Example 4

Set the ordered list to use lowercase Roman numerals:

document.getElementById("myOl").type = "i";

Try it yourself

Example 5

Set the ordered list to use uppercase Roman numerals:

document.getElementById("myOl").type = "I";

Try it yourself

Syntax

Return the type attribute:

olObject

Set the type attribute:

olObject

Attribute value

Value Description
1 Default. Decimal numbers (1, 2, 3, 4).
a An alphabetically ordered list, lowercase (a, b, c, d).
Ak A list arranged in alphabetical order, 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 value that indicates the marker type used in the ordered list.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support

Related Pages

HTML Reference Manual:HTML <ol> type Attribute