borderColor 属性设置元素周围边框的颜色。
本属性可使用 1 到 4 种颜色:
Object.style.borderColor=color-name|color-rgb|color-hex|transparent
本例改变边框的颜色:
<html>
<head>
<style type="text/css">
p
{
border: thick solid #FF0000
}
</style>
<script type="text/javascript">
function changeBorderColor()
{
document.getElementById("p1").style.borderColor="#0000FF #00FF00";
}
</script>
</head>
<body>
<input type="button" onclick="changeBorderColor()"
value="Change border color" />
<p id="p1">This is a paragraph</p>
</body>
</html>