JavaScript Element clientLeft Property Tutorial

In this section, we will learn what the Element clientLeft property is and how to use it in JavaScript.

What is Element clientLeft Property in JavaScript?

The JavaScript Element clientLeft property is used to get the width of the left border of an element.

Remember that we’re saying the width of the left border of an element! This means the padding left and margin left of an element are not included.

Element clientLeft Property Syntax:

element.clientLeft;

Element clientLeft Property Input Value

The clientLeft property is read-only and so we can’t assign a value to it.

Element clientLeft Property Return Value

The return value of this property, as mentioned before, is the width of the left border of the target element.

Example: using Element clientLeft Property in JavaScript

See the Pen using Element clientLeft Property in JavaScript by Omid Dehghan (@odchan1) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies