JSFiddle - React, Tailwind, and code Playground
HTML
<div id="myDiv" class="red"></div>
CSS
div{
width:100px;
height:100px;
}
.red{background:red;}
JavaScript
$("head").append('<style type="text/css"></style>');
var new_stylesheet = $("head").children(':last');
new_stylesheet.html('.red{background:green;}');
$('#myDiv').click(function() {
console.log("here");
$('.red', this).css('background', 'blue');
});