HTML DOM Element clientLeft
Example
Display the width of myDIV's top and left border:
let text = "Border top width: " + elmnt.clientTop + "px<br>";
text += "Border left width: " + elmnt.clientLeft + "px";
More examples below.
Description
The clientLeft property returns the width of the element's left border, in pixels.
The clientLeft property does not include the element's left padding or left margin.
The clientLeft property is read-only.
Note
The style.borderLeftWidth Property also returns the width of an element's left border.
Tutorial:
See Also:
Syntax
Return Value
More Examples
In this example, the text direction of "myDIV" is right-to-left, and it has a scrollbar:
Browser Support
element.clientLeft is supported in all browsers:
| Chrome | Edge | Firefox | Safari | Opera | IE |
| Yes | Yes | Yes | Yes | Yes | Yes |