title: Add text to input field via jQuery
body: <p>I need to add a text to input text field after clicking on a button. The button class is always the same (".button") so I think that I need to use "$(this)" but I don't know how to do it.</p>
  
  <p>My code is:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="add"&gt;
      &lt;input type="text" name="input[1]" value="" class="input[1]"&gt;
      &lt;input type="button" class="button" value="add"&gt;
  &lt;/div&gt;
  &lt;div class="add"&gt;
      &lt;input type="text" name="input[2]" value="" class="input[2]"&gt;
      &lt;input type="button" class="button" value="add" value="add"&gt;
  &lt;/div&gt;
  &lt;div class="add"&gt;
      &lt;input type="text" name="input[3]" value="" class="input[3]"&gt;
      &lt;input type="button" class="button" value="add"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$('.button').click(function(e) {
      $(this).parent('input[type=text]').val('hhh');
  });
  </code></pre>
  
  <p>Regards :)</p>