title: How to get input value dynamically using jQuery?
body: <p>I'm trying to implement the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" rel="nofollow noreferrer">DRY</a> principle in my programming style.</p>
  
  <p>To prevent misunderstanding about my question above, I will explain it one more time below. I did searching for this solution all the time, but it seems I can't find the right solution.</p>
  
  <p>I want to get each input value in the form dynamically (not a dynamic inputs, add new input dynamically, etc.) without going to type this over and over:</p>
  
  <pre><code>var foo = $('input[name="foo"]').val();
  var bar = $('input[name="bar"]').val();
  </code></pre>
  
  <p>For one or two pieces, it will be all right. But the problem is when I have more than 10 inputs, it's going to be unacceptable.</p>
  
  <p>How can I do this?</p>