English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
clientLeftThe read-only property returns the width of the left border of the element, in pixels.
The clientLeft property does not include the left margin or padding.
UsingclientTopThe property returns the width of the element's top border.
Note:When the element hasdisplay: inline
When the element's border is set to0
.
element.clientLeft
var elem = document.querySelector("div"); var txt = "Border Top Width: " + elem.clientTop + "px<br>"; txt += "Border Left Width: " + elem.clientLeft + "px";Test to see‹/›
All browsers fully support the clientLeft property:
Property | |||||
clientLeft | Yes | Yes | Yes | Yes | Yes |
Return Value: | A number representing the width of the element's left border, in pixels |
---|
HTML DOM Reference:HTML DOM clientTop Property