Sometimes, we want to resize image with JavaScript.
In this article, we’ll look at how to resize image with JavaScript.
How to resize image with JavaScript?
To resize image with JavaScript, we set the width
and height
properties.
For instance, we write
image.style.width = "50%";
image.style.height = "auto";
to set the style.width
and style.height
properties to set the width and height of the image.
Conclusion
To resize image with JavaScript, we set the width
and height
properties.