Skip to content Skip to sidebar Skip to footer

Select All Checkboxes Command Jquery, Javascript

I'm trying to get all of my checkboxes to be checked when clicking a link looks like this: select all input

Solution 1:

Try the following.

Updated. The handler is tied to an anchor therefore there will be no this.checked attribute available.

$("#select_all").click(function(){
    $("input[name^=delete]").attr('checked',  'checked');  
});

Solution 2:

jQuery Tutorial: Select All Checkbox

Solution 3:

You're going to want to use the [name^=delete] selector ("starts with"), since your checkboxes names aren't exactly "delete", they're "delete[X]' for some number X.

Post a Comment for "Select All Checkboxes Command Jquery, Javascript"