JSFiddle - React, Tailwind, and code Playground

by thecodeparadox

HTML

<img src="" height="200" width="200">

JavaScript

var $image, $imageNowWidth;
$("img").hover(function(){ //mouseenter
   $image = $(this);
   $imageNowWidth = $image.width();
},function() {            //mouseleave
    //$image and $imageNowWidth is accessible HERE
});