JSFiddle - React, Tailwind, and code Playground

by tankchintan

HTML

<div id="manual-click">Trigger CheckBox Click EVENT</div>

<br />


<input class="if_clicked_on_school" value="Casey, John Cop Faced Pandu" type="checkbox">Casey, John Cop Faced Pandu 1

<br />

<input class="if_clicked_on_school" value="Ham, Jon" type="checkbox"></td><td style="width: 100px;">Ham, Jon 1


<br />

<input class="if_clicked_on_school" value="Bam Bam, Jon" type="checkbox"></td><td style="width: 100px;">Bam Bam Ham, Jon 1


<br />

JavaScript

$(document).ready(function() {

    $("input.if_clicked_on_school").live('click', function() {
    
        $(this).attr('checked', true);
        alert($(this).is(':checked'));
    
    });

    
    $("#manual-click").click(function() {
    
        $.each($("input.if_clicked_on_school"), function(index, checkbox) {
                /*
                    if (index > 1) {
                        return false;
                    }*/
                
            
            $(this).trigger('click');
                    
                    //alert(index, $(this));
                
                });
    });

});