I am creating simple html page where one image is dynamically added to div like below
$(".step3html").html('<img class="mobimg thumbnail" src="img/'+keys+'">');
I want to resize the container after image is loaded fully (it is absolute container) . So how to check if appended image is loaded and call some function where i will run resize function based on full container width.
I tried below code immediately after appending image,It doesn't seem to fire.
$(".mobimg").on('load', function() {
alert("das");
});
Here is fiddle to test https://jsfiddle.net/whhjtwpp/2/