JQuery insertAfter parent div -


below html

<div class="col-xs-12" id="docprop_00" class="docprop">                         <div id="documentproperties" class="main_bg"></div>                  </div> 

jquery

newelement.insertafter("div.main_bg:last"); 

here inserting element after main_bg div, need insert after parent div of main_bg div. how can that??

you can use .after() method that

$(".main_bg").parent().after(newelament); 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -