JSFiddle - React, Tailwind, and code Playground

by Vladimir Sobolev

HTML

<div id="img"></div>

CSS

#img {
	width: 400px;
	height: 200px;
	background: #ddd;
}
img {
	display: block;
	width: 100%;
	height: auto;
}

JavaScript

var img = new Image(),
	src = 'http://lorempixel.com/400/200/';
$(img).on('load', function(){
	$('#img').html('<img src="'+src+'">');
});
img.src = src;