JSFiddle - React, Tailwind, and code Playground

by KevinFarrugia

HTML

<div id="elm">
    <p>lorem ipsum</p>
</div>

CSS

#elm p { background:#FF0000; color:#FFFFFF; font-weight:bold;}
    .select{ background:#000099;}

JavaScript

$(document).ready(function(){
    $('#elm').click(function(){ 
        alert();
        $("p").addClass('select') });
        function(){ $("p").removeClass('select') }
     });
});