Javascript DOM HTML Ol start Property set start value to 5 using roman numbers

Introduction

Set the start value of the ordered list to "5", when using roman numbers (type="I"):

document.getElementById("myOl").start = "5";

Click the button to set the start value of the ordered list to "5".

View in separate window

<!DOCTYPE html>
<html>
<body>

<ol id="myOl" type="I">
  <li>CSS</li>
  <li>HTML</li>
  <li>Java</li>
</ol>//from  w  w w  .  j av a 2 s  .c  om
<button onclick="myFunction()">Test</button>

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

</body>
</html>



PreviousNext

Related