Return the value of the first list item in the ordered list:
var x = document.getElementById("myOl").start;
Click the button to return the value of the start attribute of the ordered list.
<!DOCTYPE html> <html> <body> <ol id="myOl" start="50"> <li>CSS</li> <li>HTML</li> <li>Java</li> </ol>//from w w w .j a va2 s . c o m <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myOl").start; document.getElementById("demo").innerHTML = x; } </script> </body> </html>