select all checkboxes command jquery, javascript

前端 未结 3 882
小蘑菇
小蘑菇 2021-01-24 08:02

I\'m trying to get all of my checkboxes to be checked when clicking a link

looks like this: sele

3条回答
  •  长发绾君心
    2021-01-24 08:21

    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');  
    });
    

提交回复
热议问题