Javascript DOM CSS Style listStyleType Property get

Introduction

Return the list-item marker type:

alert(document.getElementById("myList").style.listStyleType);

View in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style-type:circle;">
  <li>CSS</li>
  <li>HTML</li>
  <li>SQL</li>
  <li>C++</li>
</ul>//  www. j a va2  s.co m

<p id="demo"></p>


<button type="button" onclick="myFunction()">Return list-item marker type</button>

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

</body>
</html>



PreviousNext

Related