Get the list style - Javascript CSS Style Property

Javascript examples for CSS Style Property:listStyle

Description

Get the list style

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style:decimal-leading-zero inside;">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Water</li>
  <li>Soda</li>
</ul>//  w  w  w .ja  va2  s  . c om

<button type="button" onclick="myFunction()">Return list style</button>

<script>
function myFunction() {
    console.log(document.getElementById("myList").style.listStyle);
}
</script>
</body>
</html>

Related Tutorials