Properti style.borderTopColor digunakan untuk menetapkan warna border atas suatu elemen.
Sintaks:
obj.style.borderTopColor = value;
Nilainya:
- color
Hex color, RGB color, Color name transparent
inherit
Contoh:
<HTML>
<HEAD>
<TITLE>style.borderTopColor</TITLE>
<STYLE TYPE="text/css">
#mydiv
{
width: 500px;
height: 500px;
margin: 0 auto;
border: solid red 1px;
}
</STYLE>
</HEAD>
<BODY>
<DIV ID="mydiv"></DIV>
<SCRIPT TYPE="text/javascript">
document.getElementById("mydiv").style.borderTopColor = "green";
</SCRIPT>
</BODY>
</HTML>