I have 100 inputs with the name table[]. How can I get their value with jQuery, as an array?
I am trying to do something like $_POST['table'] in PHP.
I tried the following code, but I want the values as an array…
$("input[name='table[]']").each(function(){document.write($(this).val());});
Now your arrInputValues contains all the value.
You can also use
You can see a working demo
You can use join() method to join the values in the array.
will join the array elements as a string separated by
,.