YouTip LogoYouTip

Prop Element Clientleft

# HTML DOM clientLeft Property [![Image 4: Element Object Reference](#) Element Object](#) ## Example Get the width of the top and left border of a div element: var elmnt = document.getElementById("myDIV"); var txt = "Top border width: " + elmnt.clientTop + "px
"; txt += "Left border width: " + elmnt.clientLeft + "px"; [Try it Β»](#) * * * ## Definition and Usage clientLeft represents the width of the left border of an element, in pixels. If the element's text direction is right-to-left (RTL) and a vertical scrollbar appears on the left due to content overflow, this property includes the width of the scrollbar. clientLeft does not include the left margin or left padding. **Tip:** You can use the [style.borderLeftWidth](#) property to get the width of an element's left border. **Tip:** To return the width of the top border of an element, use the (#) property. clientLeft is read-only. !(#) * * * ## Browser Support | Property | | | | | | | --- | --- | --- | --- | --- | --- | | clientLeft | Yes | Yes | Yes | Yes | Yes | * * * ## Syntax element.clientLeft ## Technical Details | Return Value: | Returns an integer representing the width of the left border of the element. | | :--- | * * * ## More Examples ## Example In the following example, the div element has a right-to-left text direction and a scrollbar: var left = document.getElementById("myDIV").clientLeft; [Try it Β»](#) * * Element Object](#)
← Docker Wait CommandDocker Top Command β†’