x
 
<!DOCTYPE html>
<html>
<body>
<div id="myDiv" style="border-left:thick solid red">这是 div 元素。</div>
<br>
<button type="button" onclick="myFunction()">返回左边框的宽度</button>
<script>
function myFunction() {
  alert(document.getElementById("myDiv").style.borderLeftWidth);
}
</script>
</body>
</html>