Set the position of the list-item marker: - Javascript CSS Style Property

Javascript examples for CSS Style Property:listStylePosition

Description

Set the position of the list-item marker:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<ul id="myList" style="list-style-position:inside;">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Water</li>
  <li>Soda</li>
</ul>/*from www. j  a  v a2s  . c  o  m*/

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

<script>
function myFunction() {
    document.getElementById("myList").style.listStylePosition = 'outside';
}
</script>

</body>
</html>

Related Tutorials