The ol element for HTML represents a list of items, where the items have been intentionally ordered, such that changing the order would change the meaning of the document.
<ol attribute-name="attribute-value"></ol> Name Value Description reversed reversed | empty Descending list if present, ascending list if not present start integer Ordinal value of the first list item
ol
{
display: block;
list-style-type: decimal;
margin: 1em 0 1em 0;
padding-left: 40px;
}
<!doctype html>
<html>
<body>
<ol start="2">
<li>list-item</li>
<li>list-item</li>
<li>list-item</li>
</ol>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
ol
{
display: block;
list-style-type: decimal;
margin: 1em 0 1em 0;
padding-left: 40px;
}
</style>
</head>
<body>
<ol>
<li>list-item</li>
<li>list-item</li>
<li>list-item</li>
</ol>
</body>
</html>
<!doctype html>
<html>
<body>
<script>
const myol = document.createElement("ol");
myol.reversed = true;
myol.start = "2";
document.body.append(myol);
for(let i = 0; i < 3; ++i)
{
const myli = document.createElement("li");
myli.innerHTML = "list-item";
myol.append(myli);
}
</script>
</body>
</html>