Jquery: Handling Checkbox Click Event with JQuery
- by wcolbert
I can't figure out what is going on here. I have some nested lists of checkboxes that I would like to check when the parent is checked. More importantly, I can't even get the alert to show up. It's as if the click event is not firing. Any ideas?
$(document).ready(function() {
$("#part_mapper_list input[type=checkbox]").click(function(){
alert("clicked");
if ($(this).attr("checked") == "checked"){
$(this + " input").attr("checked") = "checked";
} else {
$(this + " input").attr("checked") = "";
}
});
}