Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Ol type Property

Ol type Property

Ol Object Reference Ol Object

Example

Set an ordered list using lowercase letters:

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

Try it »


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 used in the list (letters or numbers).


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type attribute.


Syntax

Return the type property:

olObject

.type

Set the type property:

olObject

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

Attribute 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 the ordered list:

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

x The output is:

I

Try it »

Example

Set an ordered list using uppercase letters:

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

Try it »

Example

Set an ordered list using lowercase Roman numerals:

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

Try it »

Example

Set an ordered list using uppercase Roman numerals:

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

Try it »


Related Articles

HTML Reference Manual:HTML

    type Attribute


    Ol Object Reference Ol Object