Javascript DOM CSS Style listStylePosition Property get

Introduction

Return the position of the list-item marker:

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

View in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style-position:inside;">
  <li>CSS</li>
  <li>HTML</li>
  <li>SQL</li>
  <li>C++</li>
</ul>//from w  w  w  .  j a  va 2  s  . c  o m

<button type="button" onclick="myFunction()">Return list-item marker position</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = document.getElementById("myList").style.listStylePosition;
}
</script>

</body>
</html>



PreviousNext

Related