sajad torkamani

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.clientWidth will return zero for inline elements or elements with no CSS.
  • Element.clientWidth will round the value to an integer. To get a more accurate, fractional value, you can use Element.getBoundingClientRect().


Tagged: Web APIs

Leave a comment

Your email address will not be published. Required fields are marked *