I have this code and would like to switch between true and false the checked attribute of the input. Strangely, you're catching id
of label
because the web designer overlapped label
to input
.
(function($){
$("label").click(
function(){
var idcheck = $(this).attr("for");
$("input[id="+idcheck+"]").attr("checked", "checked");
}
);
})(jQuery);