This width is including the content and padding. But not border, margin, or vertical scroll-bar if present.
- We say “viewable” width of an element. That means if the target element has a fixed width but there was an overflow of content, then the width would be only the value set for the `width` property (which is the visible width of the element) + the size of the padding.
Element clientWidth Property Syntax:
Element clientWidth Property Input Value
The clientWidth property is read-only and so we can’t assign a value to it.
Element clientWidth Property Return Value
The return value of this property, as mentioned before, is the viewable width of the target element.
In this example, the width of the <ol> element is set to 100px and its padding to 20px.
So that’s how we got the value 140px when we’ve called the clientWidth property:
100px + 20px + 20px = 140px;