Multiple class selector to wrap div around

jquery

Solution

You can use multiple selector to select both the elements and then use .wrapAll() to wrap them with an element

$('.bigfont-m.capsletter, .headfont6.text-overhide').wrapAll('<div class="wrapper"/>')

Demo: Fiddle

Problem

I have 2 elements that I want to wrap with a new div. ``` <div class="bigfont-m capsletter"></div> <div class="headfont6 text-overhide"></div> ``` Is it possible to select both at once and use the `.wrap()` JQuery method ? I know about the multiple selector (,) but not working on my side. What I want is the new div to be like that ``` <div> <div class="bigfont-m capsletter"></div> <div class="headfont6 text-overhide"></div> </div> ```

Original source

Related problems