title: Javascript onclick function
body: <p>Q1: My point is create many buttons as many rows of array. Im having some erros here :s</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var myArray = [];
  
  $('#button').click(function(){
  
  var value1 = $('#value1').val();
  var value2 = $('#value1').val();
  var value3 = $('#value1').val();
  var newArray = []; 
  var newArray[0] = value1;
  var newArray[1] = value2;
  var newArray[2] = value3;
  myArray.push(newArray);
  
  $("#save").append(
      $("&lt;button&gt;").click(function() {
          myFunction.apply(null, myArray);
      }).text("Click me!")
     );
     });
  
  });
  
  function myFunction(value1,value2,value3)
  {
  var jsonData = $.ajax({
  url: "file.php?value1=" + value1 + "&amp;value2=" + value2 + "&amp;value3=" + value3
  dataType: "json",
  async: false
  }).responseText;
  (...)
  }
  //edited: problem maybe found. I said buttons dont do anything because of this.
  OUTPUT: file.php?value1=paul,23,USA&amp;value2=undefined&amp;value3=undefined
  //it seems that value1 gets all values :s
  &lt;/script&gt;
  
  
  &lt;div id ="save"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Im looking for a solution that return someting like this:</p>
  
  <p>eg:</p>
  
  <pre><code>&lt;!--&lt;button onclick="myFunction(name,age,country)"&gt;Click me&lt;/button&gt;--&gt;
  &lt;button onclick="myFunction(paul,23,USA)"&gt;Click me&lt;/button&gt;
  &lt;button onclick="myFunction(john,23,USA)"&gt;Click me&lt;/button&gt;
  </code></pre>
  
  <p>EDITED MY CODE WITH MORE DETAILS</p>