JSFiddle - React, Tailwind, and code Playground

HTML

<img src="http://lemerg.com/data/wallpapers/12/766931.jpg" height="300" width="500" id="img" />

JavaScript

var H = $("#img").height(),
    W = $("#img").width();

$('body').append('<br>Original image size:   1024 x 1280');

$('body').append('<br><br>Height found on DOM element:   '+H+' x '+W);

var img = new Image();
    img.src = $('#img').attr('src');
img.onload = function() {
var H2 = this.height,
    W2 = this.width;
    $('body').append('<br><br>Height found on JS element:   '+H2+' x '+W2);
}