Element.clientWidth reference
4 March 2024 (Updated 18 May 2025)
On this page
The Element.clientWidth property returns the inner width of an element in pixels, including padding but excluding borders, margins, and vertical scrollbars (if present).
Other notes
Element.clientWidthwill return zero for inline elements or elements with no CSS.Element.clientWidthwill round the value to an integer. To get a more accurate, fractional value, you can useElement.getBoundingClientRect().
Sources/links
Tagged:
Web APIs