The ol HTML element 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="10">
<li>item</li>
<li>item</li>
<li>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>item</li>
<li>item</li>
<li>item</li>
</ol>
</body>
</html>
<!doctype html>
<html>
<body>
<script>
const myelement1 = document.createElement("ol");
myelement1.setAttribute("reversed", "reversed");
myelement1.setAttribute("start", "10");
for(let i = 0; i < 3; ++i)
{
const myelement2 = document.createElement("li");
myelement2.innerHTML = "item";
myelement1.append(myelement2);
}
document.body.replaceChildren(myelement1);
</script>
</body>
</html>