Thursday, December 6, 2012

style.borderLeftWidth

Properti style.borderLeftWidth digunakan untuk menetapkan lebar border kiri suatu elemen.

Sintaks:

obj.style.borderLeftWidth = value;

Nilainya:

  • Length
  • Constants
    thin, medium (default), thick
  • inherit

Contoh:

<HTML> <HEAD> <TITLE>style.borderLeftWidth</TITLE> <STYLE TYPE="text/css"> #mydiv { width: 500px; height: 500px; margin: 0 auto; border: solid red 1px; } </STYLE> <SCRIPT TYPE="text/javascript"> function changeLeftWidth() { var list = document.forms[0].listLeftWidth; document.getElementById("mydiv").style.borderLeftWidth = list.options[list.selectedIndex].text; } </SCRIPT> </HEAD> <BODY> <DIV ID="mydiv"></DIV> <FORM> <SELECT NAME="listLeftWidth" onChange="changeLeftWidth()"> <OPTION SELECTED>medium <OPTION>thin <OPTION>thick <OPTION>10px <OPTION>20px <OPTION>30px <OPTION>40px <OPTION>50px <OPTION>60px <OPTION>70px <OPTION>80px <OPTION>90px <OPTION>100px <OPTION>200px <OPTION>300px </SELECT> </FORM> </BODY> </HTML>