How to get values of input array with jQuery

HTML Code

<input type="text" value="1" name="my_name[1]">
<input type="text" value="2" name="my_name[2]">

jQuery Code

$('input[name^="my_name"]').each(function() {
alert($(this).val());
});

Was this article helpful?

Related Articles