jquery - Wrap divs from div parent -


i have code

<div class="superdiv">    <div></div>    <div></div>  </div>

i want wrap .superdiv children divs div called <div class="subdiv"></div>

how can make ?

thanks

you use .wrapinner() method:

$('.superdiv').wrapinner('<div class="subdiv"></div>'); 

you use .wrapall() method on children elements:

$('.superdiv').children().wrapall('<div class="subdiv"></div>'); 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -