Latest web development tutorials

HTML DOM Ol type property

Ol Object Reference Ol objects

Examples

Lowercase letters setting ordered list:

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

try it"

Definition and Usage

type property sets or returns a value of type attribute ordered list.

type attribute specifies the type of (letters or numbers) to use a list of important marks.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type attribute.


grammar

Returns type attributes:

olObject .type

Setting type attributes:

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

Property Value

描述
1 默认。十进制数字(1、 2、 3、 4)
a 字母有序列表,小写(a、 b、 c、 d)
A 字母有序列表,大写(A、 B、 C、 D)
i 罗马数字,小写(i、 ii、 iii、 iv)
I 罗马数字,大写(I、 II、 III、 IV)

technical details

return value: String that represents the type of an ordered list of tags used.


More examples

Examples

Returns the type of tags used in an ordered list:

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

x The output is:

I

try it"

Examples

With an uppercase letter ordered list:

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

try it"

Examples

Lowercase Roman numeral ordered list of settings:

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

try it"

Examples

Uppercase Roman numeral ordered list of settings:

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

try it"


related articles

HTML Reference Manual: HTML <OL> of the type attribute


Ol Object Reference Ol objects