HTML DOM OlObject


Ol Object

The Ol object represents an HTML <ol> element.

Access an Ol Object

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

var x = document.getElementById("myOl"); Try it Yourself

Create an Ol Object

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

var x = document.createElement("OL"); Try it Yourself

Ol Object Properties

Property Description
compact Not supported in HTML5. Usestyle.lineHeightinstead.
Sets or returns whether the list appears more compact than normal.
reversed Sets or returns whether the list is descending.
start Sets or returns the value of the start attribute of an ordered list.
type Sets or returns the value of the type attribute of an ordered list.

Standard Properties and Events

The Ol object also supports standardpropertiesandevents。


Related Articles

HTML Reference Manual:HTML <ol> Tag

Other Extensions