<!DOCTYPE html>
<html>
<head>
<style>
#myDIV {
height: 250px;
width: 400px;
padding: 10px;
margin: 15px;
border-left: 10px solid red;
background-color: lightblue;
direction: rtl;
overflow: scroll;
}
</style>
</head>
<body>
<p>Click the button to get the width of the div's left border, in pixels.</p>
<button onclick="myFunction()">Try it</button>
<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>
function myFunction() {
var left = document.getElementById("myDIV").clientLeft;
document.getElementById("demo").innerHTML = "Border left width: " + left + "px";
}
</script>
</body>
</html>