JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" name="something"/><br />
<input type="checkbox" name="something" class="foo"/><br />
<input type="checkbox" name="something"/><br />
<input type="checkbox" name="something"/><br />

JavaScript

$(document).ready(function() {
    $("input[name=something]:checkbox").click(function() {
        if($(this).is(":checked") && $(this).hasClass("foo")) {
           // the checkbox has been checked and has a class of foo
           alert("yay!");
        }
    });
});