JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" id="myBtn" value="Click me!" />
<img src="http://static.wildberries.ru/i/loading.gif" id="loader"/>
CSS
#loader {
position: absolute;
left: 24px;
display: none;
}
#myBtn {
width: 64px;
height: 32px;
}
JavaScript
$("#myBtn").on("click", function () {
$(this).hide();
$("#loader").show();
});
$("#loader").on("click", function () {
$(this).hide();
$("#myBtn").show();
});