title: Add multiple values in input field with jQuery
body: <p>I want to add multiple input values in an input field with jQuery. So that everytime I hit the button, a new value is added in the same field along with the old value.</p>
  
  <p>I am trying following code, but it does not add the value, it simply overwrites the previous value. </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class="wrap"&gt;
      &lt;button&gt;Add value&lt;/button&gt;
      &lt;input name="myinput[]" value="" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery:</strong></p>
  
  <pre><code>$("button").click(function(e) {
      e.preventDefault();
      $(this).parent().find('input[name=myinput\\[\\]]').val("value+");   
  });
  </code></pre>
  
  <p><strong>Demo:</strong>
  <a href="http://jsfiddle.net/D97bV/" rel="nofollow">http://jsfiddle.net/D97bV/</a></p>