title: jQuery Change Value of Array Input With Skipped Indices
body: <p>I have a function in Javascript that generates dynamic <code>&lt;input&gt;</code> elements when a button is clicked. The elements get structures as such:</p>
  
  <pre><code>&lt;input name="array[0]" value="Value" /&gt;
  &lt;input name="array[1]" value="Value" /&gt;
  </code></pre>
  
  <p>What I need to do is via jQuery, replace the value of each of these elements. This would be pretty simple if the name was something like <code>name="array[]"</code>, as I could be able to call:</p>
  
  <pre><code>$("input[name='array[]']").each(function(e) {
    $(this).val("New Value");
  })
  </code></pre>
  
  <p>To replace them all, but this functionality doesn't work with these <code>name="array[N]"</code> inputs. I wish I could use that first method, but I need the <code>[N]</code> indices for something later on the backend, and changing that would destroy almost all functionality. </p>
  
  <p>Also, I've made a JSFiddle demonstrating this issue, feel free to debug with it.</p>
  
  <p><a href="http://jsfiddle.net/46o1npab/6/" rel="nofollow">JSFiddle</a></p>