Javascript DOM CSS Style listStyleImage Property get

Introduction

Return the list-style-image property value:

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

View in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style-image:url('image3.png');">
  <li>CSS</li>
  <li>HTML</li>
  <li>SQL</li>
  <li>C++</li>
</ul>//from  w w w  .  j a  v a 2  s.  c  o  m

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

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


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

</body>
</html>



PreviousNext

Related