JSFiddle - React, Tailwind, and code Playground

HTML

<div id="thisThing"></div>

<input id="yellow" type="button" name="yellow" value="yellow" />
<input id="red" type="button" name="red" value="red" />
<input id="blue" type="button" name="blue" value="blue" />

CSS

#thisThing {

    width:200px;
    height:200px;
}
.yellow {
    background:#FC2;
}
.blue {
    background:#00F;
}
.red {
    background:#F00;
}

JavaScript

$(function() {
    $('input').on('click', function() {
        var color = $(this).attr('value');
        $('#thisThing').removeClass();
        $('#thisThing').addClass(color);
    });
});