Get Ol Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Ol


The Ol object represents an HTML <ol> element.

You can access an <ol> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<ol id="myOl">
</ol>/*  w w w .ja v a  2  s  .com*/

<button onclick="myFunction()">set the list items to increment from the number "2" instead of "1"</button>

function myFunction() {
    var x = document.getElementById("myOl");
    x.start = "2";


Related Tutorials