Ol start Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Ol

Description

The start property sets or gets the start attribute of an ordered list.

Set the start property with the following Values

Value Description
number Sets the start value of the first item in the ordered list

Return Value

A Number, representing the start value of the first list item in the ordered list

The following code shows how to Set the start value of the ordered list to "75":

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<ol id="myOl" type="I">
  <li>A</li>
  <li>B</li>
  <li>C</li>
</ol>//from w  w w .  j a va2s.com

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {
    document.getElementById("myOl").start = "5";
}
</script>

</body>
</html>

Related Tutorials