title: Fill in different Input Field in Table by Clicking Links with JQuery
body: <p>How do I get the value clicked in each row (generated using AddRowTable plugin), i.e., </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $("document").ready(function(){
  $(".addRow-Max4").btnAddRow({maxRow:4, inputBoxAutoNumber:true});
  $(".delRow").btnDelRow();
  });
  &lt;/script&gt; 
  </code></pre>
  
  <p>generates maximal 4 rows in a table and numbers each input box, so I get textfield1, textfield2 and so onin my table. </p>
  
  <pre><code>&lt;table border="0" &gt;
  &lt;tr&gt;
      &lt;th colspan="2"&gt;Input your data&lt;/th&gt;
      &lt;th&gt;&lt;input type="button" value="Add Row" class="addRow-Max4"/&gt;&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
      &lt;a href="#" class="autofill"&gt;Apple&lt;/a&gt; 
      &lt;a href="#" class="autofill"&gt;Banana&lt;/a&gt; 
      &lt;a href="#" class="autofill"&gt;Mango&lt;/a&gt;
      &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="textfield" class="autofill" size="25"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src="./images/cross.gif" class="delRow" border="0"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Now I might decide for Apple in row1, Mango in row2 and so on and would like that the according textfield for this row is filled. </p>
  
  <p>I have </p>
  
  <pre><code>$("a[class=autofill]").live("click", function(){
  $("input[name=textfield1]").val($(this).text());
  return false;
  });
  </code></pre>
  
  <p>but how do I have to adjust it to make it dynamic for each row. Let's say textfield1, textfield2, textfield3 and so on. As it is right now, I change the textfield1 each time a link is clicked. But I want to just change it if one of the corresponding (same row) link is clicked. </p>