JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">container</div>
<div id="loading-img"></div>
<button id="button">Submit</button>
CSS
#loading-img {
background: url(http://web.bogdanteodoru.com/wp-content/uploads/2012/01/bouncy-css3-loading-animation.jpg) center center no-repeat;
display: none;
height: 100px;
}
.container{
background: #000;
color: #fff;
}
JavaScript
$("#button").click(function() {
$(".container").css("opacity", 0.2);
$("#loading-img").css({"display": "block"});
});