JSFiddle - React, Tailwind, and code Playground
HTML
<input class="element1" type="button"/>
<input class="another-element" type="button"/>
CSS
.left-bg{
background:red;
}
JavaScript
$('.element1').click(function() {
$('body').stop().delay(500).queue(function(){
$(this).addClass('left-bg')
});
});
$('.another-element').click(function() {
$('body').removeClass('left-bg');
});