JSFiddle - React, Tailwind, and code Playground

by peteorpeter

HTML

<div>
    <input type="checkbox"/>
    <input type="button" value="button" />
    <span>span</span>
</div>

JavaScript

/* Wrapper could be any element, methinks */
$('div').on('click', function(e){
    e.preventDefault();
});


/* Uncomment to make the checkbox work again 
$('input').on('click', function(e){
    e.stopPropagation();
});
*/

/* Other element's click's execute - the checkbox is a special case */
$('span').on('click', function(){
    $(this).text($(this).text() + ' clicked');
});
$('input:button').on('click', function(){
    $(this).val($(this).val() + ' clicked');
});