Element Properties: clientWidth

By: Dusty Arlia
Published on Friday, August 23, 2013, 07:55 PM
Last Updated on Monday, July 06, 2015 at 12:47 PM
Total Updates: 3

The clientWidth property holds the value of the width of an HTML element in pixels. This measurement includes the content area and padding. It doesn't include the size of the scrollbar, the border, or margin. If the element is an inline element, then this value is 0.

Here is the syntax for accessing clientWidth's value:

var width_value = element.clientWidth;