Thursday, December 6, 2012

style.borderTopStyle

Properti style.borderRightStyle digunakan untuk menetapkan style border atas suatu elemen.

Sintaks:

obj.style.borderTopStyle = value;

Nilainya:

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

Contoh:

<HTML> <HEAD> <TITLE>style.borderTopStyle</TITLE> <STYLE TYPE="text/css"> #mydiv { width: 500px; height: 500px; margin: 0 auto; border: solid red 1px; border-top-width: 20px; } </STYLE> <SCRIPT TYPE="text/javascript"> function changeStyle() { var list = document.forms[0].listBorderStyle; document.getElementById("mydiv").style.borderTopStyle = 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>