JSFiddle - React, Tailwind, and code Playground

by sushanth009

HTML

<div id="clicker">Clicker</div>
<div class="numbers">123456789</div>

JavaScript

$('body').on('click','.numbers' ,function(e){
    if( $(e.target).hasClass('less'){
       // Do nothing
    }
    else{
       alert('should not alert if has class less after clicker');
    }
});

$('#clicker').on('click',function(){
    $('.numbers').addClass('less');
});