Help with a simple clone question
Need help from the gurus once again. I just can't seem to grasp cycling through elements very well...haha
I have the following code that works well.
- $("#selected_products .innertxt2").live('click', function() {//used to to move product to #all_products
-
- var product_clone = $(this).clone(true);
- $(product_clone).removeClass('innertxt2');
- $(product_clone).addClass('innertxt');
-
- $('#all_products').append(product_clone);
- $(this).remove();
- });//end click
However, I would like to put the div with class innertxt2 in a table row so I can put another row below it so that when it's clicked on it triggers something other than the clone.
So it would look like:
<table>
<tr>
<td>
<div class="innertxt2">This triggers the clone</div>
</td>
</tr>
<tr>
<td>
<div class="clickme">This triggers a dialog or something</div>
</td>
</tr>
</table>
I've tried adding parent() to it like so:
- $(this).parent().clone(true);
But that didn't do anything.
Thanks in advance,
Twitch