代码示例:(标识:jsck_element_clientleft_scrollbar)
<!DOCTYPE html>
<html>
<style>
#myDIV {
  height: 250px;
  width: 400px;
  padding: 10px;
  margin: 15px;
  border-left: 10px solid red;
  background-color: lightblue;
  direction: rtl;
  overflow: scroll;
}
</style>

<body>
<h1>Element 对象</h1>

<h2>clientLeft 属性</h2>

<div id="myDIV">
  The text direction of this div is right-to-left.<br>
  And it has a scrollbar!
  <p id="demo"></p>
</div>

<script>
let left = document.getElementById("myDIV").clientLeft;
document.getElementById("demo").innerHTML = "左边框宽度:" + left + "px";
</script>

</body>
</html>
运行结果: