borderTopColor 属性设置元素上边框的颜色。
Object.style.borderTopColor=color-name|color-RGB|color-hex
本例改变段落的上边框的颜色:
<html>
<head>
<style type="text/css">
p
{
border: thick solid #FF0000
}
</style>
<script type="text/javascript">
function changeBorderColor()
{
document.getElementById("p1").style.borderTopColor="#0000FF";
}
</script>
</head>
<body>
<input type="button" onclick="changeBorderColor()"
value="Change paragraph border color" />
<p id="p1">This is a paragraph</p>
</body>
</html>