clientLeft property

The property clientLeft contains the width of the left border (border-left value). More precisely, clientLeft contains the value of the indent of the inner part of an element from the outer. In most cases, clientLeft is equal to border-left, but if the document is arranged from right to left (for example, Arabic), then clientLeft may include the scrollbar width on the left.

Syntax

javascriptelement.clientLeft;

Example

Let's find out the width of the left border of an element:

html<div id="elem"></div>
css#elem {
  width: 100px;
  height: 100px;
  border: 10px solid black;
}
javascriptlet elem = document.querySelector('#elem');
console.log(elem.clientLeft);

The code execution result:

javascript10

See also

  • the clientTop property
    that contains the width of the top border