JSFiddle - React, Tailwind, and code Playground
by Mario Perez
HTML
<p>Hello</p>
<p>Mario</p>
<div id="hello">Thing is here</div>
JavaScript
$('p').on('click', function() {
var state = $('#hello').data('state')
if (state) {
$('#hello').css('color', 'red')
$('#hello').data('state', false)
} else {
$('#hello').css('color', 'blue')
$('#hello').data('state', true)
}
});