dynamically setting image height and width in html code example
Example: how to set image width and height dynamically in javascript
document.addEventListener('DOMContentLoaded', function() {
var image = document.getElementById("container");
alert(`${image.width} x ${image.height}`);
}, false);