Change the type and position of a list to "square inside": - Javascript CSS Style Property

Javascript examples for CSS Style Property:listStyle

Description

Change the type and position of a list to "square inside":

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Water</li>
  <li>Soda</li>
</ul>// ww w  . jav  a 2 s . c o  m

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

<script>
function myFunction() {
    document.getElementById("myList").style.listStyle = "square inside";
}
</script>
</body>
</html>

Related Tutorials