There are markup

<form class="inputs"> <input type="text" value="1"/> <input type="text" value="2"/> <input type="text" value="3/> </form> 

When you click on the button, you need to get all the input values ​​and write to the array.

I do it but does not work.

  $('.test').click(function() { var test = []; $('.inputs').find(':input').each(function(i, input) { test.push(input.value()); }); }); 

    1 answer 1

    Here's a working example for you ...

     $('#go').click(function() { var test = []; $('.inputs').find(':input').each(function(i, input) { test.push($(input).val()); }); alert(test); }); 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form class="inputs"> <input type="text" value="1" /> <input type="text" value="2" /> <input type="text" value="3" /> </form> <button id="go">пуск</button>