JSFiddle - React, Tailwind, and code Playground

HTML

<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>

CSS

.box {
    background: url(http://placehold.it/50x50), no-repeat;
    display: block;
    width: 50px;
    height: 50px;
}
.box.active {
    background: url(http://placehold.it/100x100), no-repeat;
    width: 100px;
    height: 100px;
}

JavaScript

$(document).ready(function(){
    $('.box').click(function(){
        if($(this).hasClass('active')){
            $(this).removeClass('active');
        }
        else{
            $(this).addClass('active');
        }
    });
})