HTML DOM Ol Object

Ol Object

The 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

Properties Description
compact

Not supported in HTML5.Please use style.lineHeight instead

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 Sets or returns the start attribute value of the ordered list.
type Sets or returns the type attribute value of the ordered list.

Standard Properties and Events

Ol Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <ol> Tag