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
Post a Comment