How change height and width to an image inside array using javascript?

Hello I’m wondering how to change the size to de images in the array?

JS;

var ArrayOfImages = ['1.png', '2.png', '3.png']; 
ArrayOfImages.forEach(function(image) { 
  var img = document.createElement('img');
  img.src = image;                        
  document.body.appendChild(img);         
});

Check out the HTMLElement.style for JavaScript.

1 Like