Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Ol object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Ol object


Ol object

The Ol object represents an HTML-lt;ol-gt;

Access the Ol object

You can use getElementById() to access the elements:

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

Create an Ol object

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

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

Ol object properties

Attributes describe
compact It is not supported in HTML5.use style.lineHeight Replace.
Set or return to the list that is more compact than normal conditions.
reversed Set or return to the list is descending.
start Set or return the value of the START attribute of an ordered list.
type Set or return the value of the TYPE attribute of an ordered list.

Standard properties and events

Ol objects also support standard properties and events.


Related articles

HTML Reference Manual: HTML slt;ol> Tags