JavaScript에서 왼쪽 테두리의 너비를 설정하려면 borderLeftWidth 재산. 테두리에 대해 원하는 이 속성 아래의 너비를 설정합니다. 다음 코드를 실행하여 왼쪽 테두리의 너비를 설정하는 방법을 배울 수 있습니다 -
예시
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: thick solid gray;
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<div id = "box">Demo Text</div>
<br>
<br>
<button type = "button" onclick = "display()">Change left border width</button>
<script>
function display() {
document.getElementById("box").style.borderLeftWidth = "10px";
}
</script>
</body>
</html>