JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<button>
Click
</button>
</div>
CSS
#container {
width: 100%;
height: 1000px;
padding: 20px;
background-color: orange;
}
button {
font-size: 24px;
margin-bottom: 30px;
}
img {
width: 50px;
height: 50px;
}
JavaScript
$('button').on('click',function(){
var $newImg = $('<div><img class="image" src="http://images.clipartpanda.com/ninja-clip-art-000056m.jpg" /></div>');
$('#container').append($newImg);
});
$('.image').on("load", function(){
$(this).after("This is a ninja");
});