JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">test</div>

CSS

.blue
{
    background-color:Blue;
}

.red{
    background-color:Red;
}

JavaScript

$('#test').addClass('red');
$('#test').addClass('blue');
$('#test').addClass('red');
$('#test').addClass('blue');