JSFiddle - React, Tailwind, and code Playground
HTML
<li class="selector">
<a>
<input type="checkbox" value="test" /> test
</a>
</li>
<li class="selector">
<a>
<input type="checkbox" value="test" /> test
</a>
</li>
JavaScript
$('.selector').on('click', function(e) {
if (e.target.type === "checkbox") return;
$(this).find("input[type=checkbox]").prop("checked", function(i,v) {
return !v; // set to opposite of current value
});
});