JSFiddle - React, Tailwind, and code Playground
HTML
<div id="teste"></div>
<img id="img" src="http://placehold.it/300"/>
JavaScript
var showHeight = (function(elem, height) {
$("#teste").text("The height for the " + elem +
" is " + height + "px.");
});
$("body").on("click", function() {
showHeight("img", $("#img").height());
});