Get checkbox values using checkbox name using jquery

前端 未结 8 1825
刺人心
刺人心 2021-02-05 00:32

I have several input checkboxes, (they name is same for send array on server).

So, I need get each value this checkboxes and I want use as selector checkbox names, this

8条回答
  •  执笔经年
    2021-02-05 00:59

    You are selecting inputs with name attribute of "bla", but your inputs have "bla[]" name attribute.

    $("input[name='bla[]']").each(function (index, obj) {
            // loop all checked items
        });
    

    http://jsfiddle.net/26axX/

提交回复
热议问题