title: update attributes of child elements after jQuery clone function
body: <p>I had some code that seemed to work ok with older versions of jQuery, up until 1.4 I think.  I noticed it stopped working for sure with 1.4.4.  And still doesn't work with 1.6.2.  I did some research and there are some similar questions on this issue, but I haven't found a scenario where something more than just the id has to be updated after doing a clone().</p>
  
  <p>Does anyone know how I can re-write this so it'll work with the current version of jQuery?</p>
  
  <pre><code> //Add dynamic Shot handling
  $('#link_addShot').click(function() {
    var cloned = $('#tbl_shots tbody tr:last').clone(true);
    prevNum = numOfShots;
          numOfShots = numOfShots + 1;
    $('#shot_number_' + prevNum, cloned).attr('name', 'shot_number_' +  numOfShots);
          $('#shot_type_id_' + prevNum, cloned).attr('name', 'shot_type_id_' +  numOfShots);
          $('#player_id_' + prevNum, cloned).attr('name', 'player_id_' +  numOfShots);
  
          $('#shot_number_' + prevNum, cloned).attr('id', 'shot_number_' +  numOfShots);
          $('#shot_type_id_' + prevNum, cloned).attr('id', 'shot_type_id_' +  numOfShots);
          $('#player_id_' + prevNum, cloned).attr('id', 'player_id_' +  numOfShots);
    $('#removeLink', cloned).html('&lt;a href="#"&gt;Remove&lt;/a&gt;');
    $('#removeLink a', cloned).click(function() {
      $(this).parent().parent().parent().remove();
      return false;
    })
  
    $('#shot_type_id_' + numOfShots, cloned).val(0);
          $('#player_id_' + numOfShots, cloned).val(0);
  
    $('#tbl_shots').append(cloned);
    $(this).removeClass('form_button_hover');
    return false;     
  });
  
      //remove link handling
      $(".link_remove").click(function() {
          $(this).parent().parent().parent().remove();
          return false;
      });
  </code></pre>
  
  <p>Oh, it'll probably help if I include the tr markup I'm trying to clone:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;&lt;input id="shot_number_5" type="hidden" value="" name="shot_number_5"&gt;
  &lt;select id="shot_type_id_5" class="shot_type_id" name="shot_type_id_5"&gt;
    &lt;option value="0"&gt;Unknown&lt;/option&gt;
    &lt;option value="1"&gt;Tee&lt;/option&gt;
    &lt;option value="2"&gt;Fairway&lt;/option&gt;
    &lt;option value="3"&gt;Rough&lt;/option&gt;
    &lt;option value="4"&gt;Bunker (fairway)&lt;/option&gt;
    &lt;option value="8"&gt;Bunker (greenside)&lt;/option&gt;
    &lt;option value="5"&gt;Fringe&lt;/option&gt;
    &lt;option selected="selected" value="6"&gt;Green&lt;/option&gt;
    &lt;option value="7"&gt;Penalty&lt;/option&gt;
    &lt;option value="9"&gt;Concede&lt;/option&gt;
    &lt;option value="10"&gt;Pick Up&lt;/option&gt;
  &lt;/select&gt;&lt;/td&gt;
  &lt;td class="td_last" align="center"&gt;&lt;div id="removeLink"&gt; &lt;a class="link_remove" href=""&gt;Remove&lt;/a&gt; &lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>