JSFiddle - React, Tailwind, and code Playground

HTML

<img id="my_image" src="http://www.dhems.x10.mx/inicio.jpg" width="500">
	<p id="display_size">Display Size: 0 x 0</p>
	<p id="native_size">Original Size: 0 x 0</p>

JavaScript

(function() {

	var img = document.getElementById('my_image');
	
	// Original
	var width, height;
	
	// Display
	var d_width = img.width;
	var d_height = img.height;
	
	var updateDetail = function() {
		document
			.getElementById('display_size')
			.innerHTML = 'Display Size: ' + d_width + ' x ' + d_height;
	
		document
			.getElementById('native_size')
			.innerHTML = 'Original Size: ' + width + ' x ' + height;
	};
	
	// Using naturalWidth/Height
	if (img.naturalWidth) {
		width = img.naturalWidth;
		height = img.naturalHeight;
		
		updateDetail();
	} else {
		// Using an Image Object
		img = new Image();
		img.onload = function() {
			width = this.width;
			height = this.height;
			
			updateDetail();
		};
		img.src = 'http://lorempixel.com/output/nature-q-c-640-480-3.jpg';
	}

}());