<img src="https://en.js.cx/clipart/ball.svg" id="first" width="40">
<img src="https://en.js.cx/clipart/ball.svg" id="second">
console.log(first.clientWidth); // 40
console.log(second.clientWidth); // 0 ПОЧЕМУ???
alert(first.clientWidth); // 40
alert(second.clientWidth); // 40
The Element.clientWidth property is zero for inline elements
img is a replaced element; it has a display value of inline by default