javascript - Append a div as a parent of an ul -


i have html.

<div class="col-xs-6">  <div class="datatables_paginate">   <!-- content here -->  </div> </div> 

having this, want append new div @ top of datatables_paginate new html this.

<div class="col-xs-6">   <div class="ui menu pagination">      <div class="datatables_paginate">        <!-- content here -->      </div>    </div> </div> 

if try

$('.datatables_paginate').parent().append('<div class="ui pagination menu"></div>') 

this append div dosnt wrapp datatables_paginate div inside new appended div.

you can use jquery wrap function this. try code:-

$('.datatables_paginate').wrap('<div class="ui pagination menu"/>'); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -