Create a Parent div for multiple child divs - Jquery -


my code goes this,

<div class="sexample">     <div class="child1 one">...</div>     <div class="child2 one">...</div>      <table>...</table>     <div class="child3">...</div> </div> 

i want include parent div .child1 , .child2 targeting class .one. tried jquery .wrap method, adding parent div each items.

please me this.

assuming want result this:

<div class="sexample">     <div>         <div class="child1 one">...</div>         <div class="child2 one">...</div>     </div>      <table>...</table>     <div class="child3">...</div> </div> 

use wrapall() instead of wrap():

$('.one').wrapall('<div>'); 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -