HTML DOM Ol Obheto

Ol object

Ol object represents the HTML <ol> element.

Access Ol object

You can access the <ol> element by using getElementById():

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

Try it yourself

Create Ol object

You can create an <ol> element by using the document.createElement() method:

var x = document.createElement("OL");

Try it yourself

Ol object properties

属性 description
compact

Not supported in HTML5.Please use style.lineHeight replace

Set or return whether the list should be displayed slightly smaller than the normal value.

reversed Set or return whether the list order is descending.
start 设置或返回有序列表的 start 属性值。
type 设置或返回有序列表的 type 属性值。

标准属性和事件

Ol 对象支持标准属性事件

相关页面

HTML 参考手册:HTML <ol> 标签