Javascript DOM CSS Style listStyle Property get

Introduction

Return the list style:

document.getElementById("myList").style.listStyle;

View in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style:decimal-leading-zero inside;">
  <li>CSS</li>
  <li>HTML</li>
  <li>SQL</li>
  <li>C++</li>
</ul>//from   w  w w.j  a  v  a2  s . co m

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

<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = document.getElementById("myList").style.listStyle;
}
</script>

</body>
</html>



PreviousNext

Related