title: How to populate a list and send it through jquery ajax?
body: <p>I have a table of inputs and I want to get all the input values and populate them in a list or array and send them using jquery ajax. Is it possible to do it???</p>
  
  <p>Suppose I have a table of inputs like this:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;&lt;input type="text" id="ques1"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="ans1"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="text" id="ques2"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="ans2"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="text" id="ques3"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="ans3"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Now I want those inputs values and populate a list and send through ajax...</p>
  
  <pre><code>var arr={};
      for(var i=1;i&lt;=3;i++){
          arr['ques']=   //Don't know how to get values of ques
          arr['ans']=  //Don't know how to get values of ans
          $(this).push(arr);
      }
      console.log(arr);
  
  $.ajax({
              url: "something.php",
              type: "POST",
              data: {"arr":arr }, 
              dataType:"JSON",
              success: function(response) {
                  if(response.length!=0){
                     alert("Done!");
                  }
          });
  </code></pre>