get length and width of image dynamically javascript 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);