JSFiddle - React, Tailwind, and code Playground

by hiral

JavaScript

$("body").html("<img src='http://i.imgur.com/o8FWrWWjpg' height='100' width='130' class='img'/>");
$(".img").on("error", function () {
    this.src = "http://i.imgur.com/o8FWrWW.jpg";
    $(this).off("error");
});