JSFiddle - React, Tailwind, and code Playground
HTML
<img id="foo" src="data:" alt=""/>
JavaScript
$(window).load(function() {
console.log("You should see me only once.");
});
$(document).ready(function() {
$('#foo').load(function() {
console.log('My event will bubble up.');
});
window.setTimeout(function() {
$('#foo').trigger('load');
});
});