change image size during resize javascript code example
Example 1: javascript resize image
const img = document.querySelector('img');
img.width = 128;
img.height = 128;
img.style.width = '10em';
img.style.height = '10em';
const range = document.querySelector('input[type=range]');
range.addEventListener('mousemove', evt => {
img.style.width = evt.target.value + '%';
});
Example 2: how to change size of image js
var image = document.getElementById('id');
image.style.width='imgWidth';
image.style.height='imgHeight';