JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<div>
<img src="http://dummyimage.com/100x100/000/fff" />
</div>
<div>
<img src="http://dummyimage.com/200x100/000/fff" />
</div>
<div>
<img src="http://dummyimage.com/300x100/000/fff" />
</div>
JavaScript
$("div").each(function(index) {
var $img_width = $(this).children('img').width();
var $img_height = $(this).children('img').height();
$(this).mouseenter(function() {
alert($img_width)
}).mouseleave(function() {
alert($img_width);
});
alert($img_width);
});