Thursday, December 6, 2012

style.listStylePosition

Properti style.listStylePosition digunakan untuk menetapkan posisi list-item marker.

Sintaks:

obj.style.listStylePosition = value;

Nilainya:

  • Constants
    outside (default), inside
  • inherit

Tampilan OUTSIDE:

  • Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...
  • Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...

Tampilan INSIDE:

  • Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...
  • Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...

Contoh:

<HTML> <HEAD> <TITLE>style.listStylePosition</TITLE> </HEAD> <BODY> <DIV STYLE="width: 200px;"> <UL ID="mylist"> <LI>Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</LI> <LI>Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</LI> <LI>Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</LI> <LI>Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</LI> <LI>Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</LI> </UL> </DIV> <SCRIPT TYPE="text/javascript"> var ulElem = document.getElementById("mylist"); ulElem.style.listStylePosition = "outside"; ulElem.style.listStyleType = "disc"; </SCRIPT> <BUTTON TYPE="button" ONCLICK="document.getElementById('mylist').style.listStylePosition = 'inside';">Inside!</BUTTON> <BUTTON TYPE="button" ONCLICK="document.getElementById('mylist').style.listStylePosition = 'outside';">Outside!</BUTTON> </BODY> </HTML>