Thursday, December 6, 2012

style.borderLeftStyle

Properti style.borderLeftStyle digunakan untuk menetapkan style border kiri suatu elemen.

Sintaks:

obj.style.borderLeftStyle = value;

Nilainya:

  • Constants
    none (default), dotted, dashed, solid, double, groove, ridge, inset, outset
  • inherit

Contoh:

<HTML> <HEAD> <TITLE>style.borderLeftStyle</TITLE> <STYLE TYPE="text/css"> #mydiv { width: 500px; height: 500px; margin: 0 auto; border: solid red 1px; border-left-width: 20px; } </STYLE> <SCRIPT TYPE="text/javascript"> function changeStyle() { var list = document.forms[0].listBorderStyle; document.getElementById("mydiv").style.borderLeftStyle = list.options[list.selectedIndex].text; } </SCRIPT> </HEAD> <BODY> <DIV ID="mydiv"></DIV> <FORM> <SELECT NAME="listBorderStyle" onChange="changeStyle()"> <OPTION SELECTED>none <OPTION>dotted <OPTION>dashed <OPTION>solid <OPTION>double <OPTION>groove <OPTION>ridge <OPTION>inset <OPTION>outset </SELECT> </FORM> </BODY> </HTML>