clone then alter table row before inserting back with jquery
<p>I have 2 tables one, with a list of products to choose from and one with products chosen.  I also have a link in each to add from one and delete from the other.  When you delete from one of the tables I want to copy and insert into the other table but I need to change the link href before doing so, then add a click behavior to it.</p>

<p>Here is the table row I am cloning.</p>

<pre><code>&lt;tr&gt; 
        &lt;td&gt;&lt;a href="/Partner/DeleteProduct/41/?ProductID=935ad105-xxxx-xxxx-xxxx-659cd4c55ec7"  class="delete"&gt;&lt;img src="/Content/images/remove.png" alt="Delete" /&gt;&lt;/a&gt; &lt;span id="705"&gt;GastroMend-HP &lt;/span&gt;&lt;/td&gt; 
        &lt;td&gt;Designs for Health&lt;/td&gt; 
&lt;/tr&gt; 
</code></pre>

<p>Here is my code so far, which properly moves the row but worth the wrong link href, although I did properly change the img path like I wanted to  (#Product is the table I am adding to).</p>

<pre><code>$('a.delete').click( function(e){
var el = $(this)
  // hide the clicked row
  el.parent().parent().fadeOut();
      // this does my server work
      $.get(el.attr('href'), function(data) {
          // this is the row cloning part I need to tweak
          el.parent().parent().clone().insertAfter('#Product tr:first').find('img').attr('src','/Content/images/insert.png');
      });
  e.preventDefault();
});
</code></pre>
