I want to clone my tr that has a class name cloneme inside a table please help me 🙁
here is my html code :
<table cellspacing="10" class="tbll" >
<tr>
<td>Choose Sub Heading</td><td><select name="subheading_id" style="min-width:145Px">
<option value="1" Sub heading Me</option>
<option value="2" Sub heading Me 2</option>
</select></td><td> </td>
</tr>
<tr classs="cloneme">
<td>Choose Job Title</td><td><select name="jobtitles_id" style="min-width:145Px"><?php
<option value="a" >A</option>
<option value="b" >B</option>
<option value="c" >C</option>
<option value="none" >None</option>
</select></td>
</tr>
<tr>
<td><div class="addjob" >Add another Job Title</div></td>
</tr>
</table>
Here is my jQuery :
$(".addjob").click(function(){
var $clone = $('table.tbll tr.cloneme').clone();
$('table.tbll').append($clone);
});
thanks in advance..
You have a typo. It’s
class="cloneme"notclasss="cloneme"jQuery was not able to find the
trthat you wanted to clone.http://jsfiddle.net/6r4Q4/1/
You also had some invalid html, but I don’t think that was affecting it.