title: Set value of array of input fields, by name
body: <p>I have a set of input fields on my page. They're setup as an array like so:</p>
  
  <pre><code>&lt;input type="text" name="test[name][]" /&gt;&lt;br /&gt;
  &lt;input type="text" name="test[name][]" /&gt;&lt;br /&gt;
  &lt;input type="text" name="test[name][]" /&gt;&lt;br /&gt;
  &lt;input type="text" name="test[name][]" /&gt;
  </code></pre>
  
  <p>What i need to do next it to set a unique value in each textfield. But i don't know how to iterate over these fields with jQuery. My attempt failed: <strong><a href="http://jsfiddle.net/hGTKG/" rel="nofollow">DEMO</a></strong></p>
  
  <pre><code>$(function() {
      $.each('input[name="test[name][]"]', function() {
          $(this).val('blaat');
      });
  });
  </code></pre>
  
  <p>Any idea how i can iterate over each input field, selecting them by name!? I don't have any influence on these controls. So i <strong>cannot</strong> give them an extra class name or anything like that. All i have are their names.</p>