uriah
uriah

Reputation: 2573

insertBefore multiple classes

What's the correct syntax to insert multiple different classes with jquery. What if I wanted to insert .one .two and .three before the #container.

$(".one").insertBefore($('#container'));

Thanks for the advice!

Upvotes: 2

Views: 666

Answers (1)

Alex
Alex

Reputation: 9471

Just like with CSS selectors:

$('.one, .two, .three').insertBefore($('#container'));

Upvotes: 3

Related Questions