JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" /><button />

JavaScript

(function($) {
    var existingAttr = jQuery.fn.attr;

    jQuery.fn.attr = function(attr) {
        var result = existingAttr.apply(this, arguments);

        if (result instanceof jQuery && attr == "checked") { // If we're dealing with a check-set operation.
            result.trigger('change');
        }

        return this;
    };

}(jQuery));

$(':checkbox').bind('change', function() {
    alert('called');
});

$('button').bind('click', function() {
    $(':checkbox').attr('checked', function(i, curr) {
        return !curr;
    });
});