How to get current image size (width and height) using JavaScript

Today we will show you how to get current image size (width and height) using JavaScript.

You can simply use the clientWidth and clientHeight to get the current width and height of the image in pixel.

Refer to the sample HTML code below to get the image size.

Using the code above you will find the width and height of the current image in the console.

That’s it for today.
Thank you for reading. Happy Coding..!! 🙂

If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

Leave a Reply

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