JSFiddle - React, Tailwind, and code Playground

by zupa

HTML

<input type="checkbox" id="myelement" />

JavaScript

$('#myelement').change(function() {
    $('body').append('<div>change OR click handled 1x</div>');
});
$('#myelement').trigger('change');


/*
 * Try clicking the checkbox, it fires 1x
 * Try hitting space after the click (so the box is selected),
 *   again, it fires once.
 */