offline version v3


⊗jsSpMECS 16 of 281 menu

Client element size in JavaScript

The following properties contain the client element size, which includes the size of the content and padding, and doesn't include the scrollbar:

console.log(elem.clientWidth); // a width console.log(elem.clientHeight); // a height

These dimensions are indicated in the figure:

Given an element and a button. When the button is clicked, print the client width and height of the element to the console.

enru