How to get an Array with jQuery, multiple <input> with the same name

前端 未结 9 679
既然无缘
既然无缘 2020-11-28 19:02

I have a form where users can add input fields with jQuery.


After submitting the

9条回答
  •  悲哀的现实
    2020-11-28 19:22

    For multiple elements, you should give it a class rather than id eg:

    
    

    Now you can get those using jquery something like this:

    $('.task').each(function(){
       alert($(this).val());
    });
    

提交回复
热议问题