Get the list-item marker type: - Javascript CSS Style Property

Javascript examples for CSS Style Property:listStyleType

Description

Get the list-item marker type:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style-type:circle;">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Water</li>
  <li>Soda</li>
</ul>/*  w  w  w  .  ja v a2  s . c o m*/

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

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

</body>
</html>

Related Tutorials