Latest web development tutorials

HTML DOM Ol objects

Ol objects

Ol object represents an HTML <ol> element.

Ol Object Access

You can use getElementById () to access the <ol> element:

var x = document.getElementById("myOl"); 尝试一下

Create Ol objects

You can use the document.createElement () method to create <ol> element:

var x = document.createElement("OL"); 尝试一下

Ol object properties

属性 描述
compact HTML5 中不支持。使用 style.lineHeight 替代。
设置或返回列表是否呈现比正常情况更小巧的效果。
reversed 设置或返回列表是否为降序。
start 设置或返回有序列表的 start 属性的值。
type 设置或返回有序列表的 type 属性的值。

Standard properties and events

Ol objects also supports standard attributes and events .


related articles

HTML Reference Manual: HTML <OL> tag