JSFiddle - React, Tailwind, and code Playground

by spaipalle

HTML

<div class="testClass">
    <input id="111" name="compare_checkbox" type="checkbox" />
    <label for="111"> 
        <i class="icon" aria-hidden="true"></i>  <b>Compare</b>
    </label>
</div>

JavaScript

$('#111').click(function(){
    if($('#111').is(":checked")){
            alert('checked');
            $('#111')[0].checked = false; // uncheck it
    }else{
            alert('unchecked');
    }
});