JSFiddle - React, Tailwind, and code Playground
by Leo Cavalcante
HTML
<form id="formulario">
<input type="checkbox" /><br/>
<input type="checkbox" /><br/>
<input type="checkbox" /><br/>
<input type="text" />
</form>
JavaScript
// NÃO POSSO ALTERAR ===== I cann`t change this
$("#formulario").delegate("input", "click", function(){ alert("clicou!") });
$("#formulario").delegate("input:checkbox", "click", function() {
alert("Eu quero funcionar pros checkboxes! :( #chateado");
});
//=========================
// Funciona / work
$('#formulario :checkbox').bind("click", function (e) {
e.stopImmediatePropagation();
});
// Funciona / work
$(':checkbox').bind("click", function (e) {
e.stopImmediatePropagation();
});
$('#formulario :checkbox').on('click', function(event) {
alert('Eu também quero funcionar! :( #chateado 2');
});
// Não == Not, Sim == Yes
// $('#formulario').undelegate("input", "click"); Sim, mas remove todos...
//$('#formulario').undelegate("input:checkbox", "click"); Não
//$("#formulario :checkbox").unbind("click"); Não
//$("#formulario").undelegate(":checkbox", "click"); Não
//$("#formulário").off("click", ":checkbox"); Não
//$("#formulario :checkbox").off("click"); Não