Is there an API to get dimension of image from JavaScript or jQuery?
javascript jquery image
There are clientWidth and clientHeight among DOM properties.
var img = document.getElementById('imageid');
//or however you get a handle to the IMG
var width = img.clientWidth;
var height = img.clientHeight;
I think you can write it like this.
© 2024 OneMinuteCode. All rights reserved.