jQuery wrapAll wraps specified HTML element(s) in the set of matched elements.
This takes any string or object for passing into $() function to specify the HTML DOM structure. Around all the elements the structure will be wrapped as a single group.
Suppose you have following HTML:
<div class="main"> <div class="sub">John Doe</div> <div class="sub">Jane Doe</div> </div>
Now a new <div> wrapped around all matched elements to the HTML DOM structure:
$( ".sub" ).wrapAll("<div class='new' />");
The result will be:
<div class="main"> <div class="new"> <div class="sub">John Doe</div> <div class="sub">Jane Doe</div> </div> </div>
For more information click here.
In a world where digital presence is paramount, the question isn't whether you should do…
Over the years, people have experimented with various methods to maintain healthy and beautiful hair.…
Your brand more than developing an attractive and creative logo and infectious motto. It's the…
Introduction Are you someone who has suffered from a personal injury and want to file…
Operating from home has emerged as one of the most popular ways of doing jobs…
If the consequences of our society’s ever-growing debt are what worries you, then it is…
View Comments
Thank you for sharing with us, I think this website really stands out.