Return the kind of marker used in an ordered list:
var x = document.getElementById("myOl").type;
Click the button to return the value of the type attribute of the ordered list.
<!DOCTYPE html> <html> <body> <ol id="myOl" type="I"> <li>CSS</li> <li>HTML</li> <li>Java</li> </ol>/*from ww w . j av a 2 s. c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myOl").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>