jQuery : Append to outer tr in a table

kjyiwt8sey

New Member
please help me, i'm trying to append element outside the tr of div class addjob and i dont know how to do this.. BTW this how this function work.. whenever i try to click the add jobtitle it must append it outside the tr>td>div.addjobhere is my jquery :\[code\] $(function() { $('body').on('click','.rmv',function(){ $(this).parents('tr').hide('slow', function(){ $(this).parents('tr').remove(); });});$('body').on('click','.addjob',function(){ var $clone = $('table.tbll tr.cloneme:first').clone(); console.log($clone); $clone.append("<td><div class='rmv' >Remove</div></td>"); ($(this)).append($clone); }); });\[/code\]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="http://stackoverflow.com/questions/14557009/1" Sub heading Me</option> <option value="http://stackoverflow.com/questions/14557009/2" Sub heading Me 2</option> </select></td><td>&nbsp;</td></tr><tr class="cloneme"><td>Choose Job Title</td><td><select name="jobtitles_id" style="min-width:145Px"><?php <option vhttp://stackoverflow.com/questions/14557009/alue="a" >A</option> <option value="http://stackoverflow.com/questions/14557009/b" >B</option> <option value="http://stackoverflow.com/questions/14557009/c" >C</option> <option value="http://stackoverflow.com/questions/14557009/none" >None</option> </select></td></tr><tr><td><div class="addjob" >Add another Job Title</div></td></tr></table>\[/code\]Thanks in advance!!
 
Back
Top