title: Copy previous row's input value in new row's input?
body: <p>Hey StackOverflow people,
  I'm using a table form. </p>
  
  <p>Here is a simplified version of my form:</p>
  
  <pre><code>&lt;script&gt;
  $('#addrowbutton').click(function() {
  $('tr:hidden:first').show();
  });
  &lt;/script&gt;
  
  &lt;html&gt;
  &lt;button id="addrowbutton"&gt;Add Row&lt;/button&gt;
  
  &lt;form&gt;
  &lt;table&gt;
  &lt;tbody&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Select&lt;/th&gt;
  &lt;/tr&gt;
  
  &lt;tr id="tr1" class="tr"&gt;
  &lt;td&gt;
  &lt;input type="radio" name="color1" class="colorinput" value="red"&gt;Red 
  &lt;input type="radio" name="color1" class="colorinput" value="blue" checked&gt;Blue
  &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr id="tr2" class="tr" style="display:none"&gt;
  &lt;td&gt;
  &lt;input type="radio" name="color2"  class="colorinput" value="red"&gt;Red 
  &lt;input type="radio" name="color2" class="colorinput" value="blue"checked&gt;Blue
  &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr  id="tr3" class="tr" style="display:none"&gt;
  &lt;td&gt;
  &lt;input type="radio" name="color3"  class="colorinput" value="red"&gt;Red 
  &lt;input type="radio" name="color3" class="colorinput" value="blue" checked&gt;Blue
  &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr  id="tr4" class="tr" style="display:none"&gt;
  &lt;td&gt;
  &lt;input type="radio" name="color4"  class="colorinput" value="red"&gt;Red 
  &lt;input type="radio" name="color4" class="colorinput" value="blue" checked&gt;Blue
  &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>When the "#addrowbutton" is clicked, the first hidden row appears.
  I would then want that new appearing row's radio input to have the same value as the previous row's ".colorinput".</p>
  
  <p>Right now I have tried, before ending });  :</p>
  
  <pre><code>$('tr:visible:last .colorinput').val($(.prev('tr .colorinput')).val());
  </code></pre>
  
  <p>EDIT: Please, no clone/append solution.</p>