JSFiddle - React, Tailwind, and code Playground
HTML
<img src="fafav.jpg" id="img" />
JavaScript
$(function(){
$('#img').error(function(){
alert('error');
});
});
<img src="fafav.jpg" id="img" />
$(function(){
$('#img').error(function(){
alert('error');
});
});