JSFiddle - React, Tailwind, and code Playground

by karim79

HTML

<div>test test test<input type="checkbox"/></div>

JavaScript

$("div").click(function(e) {
    if (e.target.type == "checkbox") {
        e.stopPropagation();
    } else {
        var $checkbox = $(this).find(':checkbox');
        $checkbox.attr('checked', !$checkbox.attr('checked'));
    }
});