Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery select an element by multiple css classes

jQuery Class selector works well if you have a single class assigned to an element. What if I assign two classes to an element(Ex: <div class="one two">), how can I find that element if I know these two classes?

like image 921
dev.e.loper Avatar asked Jun 01 '10 14:06

dev.e.loper


2 Answers

$("div.one.two")

like image 148
Matthew Avatar answered Oct 10 '22 06:10

Matthew


$('.one.two');

more on multiple selectors if you just did a search on SO first.

like image 23
Reigel Avatar answered Oct 10 '22 05:10

Reigel