JavaScript에서 하단 테두리의 색상을 설정하려면 borderBottomColor를 사용하세요. 재산. 테두리 하단의 테두리 색상을 설정할 수 있습니다.
예시
아래 코드를 실행하여 하단 테두리의 색상을 설정하는 방법을 배울 수 있습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: 2px dashed blue;
width: 120px;
height: 120px;
}
</style>
</head>
<body>
<button onclick="display()">Set border bottom color</button>
<div id="box">
<p>Demo Text</p>
<p>Demo Text</p>
</div>
<script>
function display() {
document.getElementById("box").style.borderBottomColor = "yellow";
}
</script>
</body>
</html>