How do I get values of input element with the same name as an javascript array?

后端 未结 3 1368
孤独总比滥情好
孤独总比滥情好 2020-12-16 05:51

I want to get values of the input element that those elements are under the same name, name=\"items[]\"
for example:

...
3条回答
  •  鱼传尺愫
    2020-12-16 06:15

    Or use jQuery's map function:

    $("div input[name='items[]']").map( function() { return $(this).val(); } ).get();
    

提交回复
热议问题