Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to select two classes at the same time in jquery?

Tags:

jquery

I want to select:

<tr class='odd-row'>

and

<tr class='even-row'>

at the same time using jquery, is it possible?

like image 351
Kris Avatar asked Jun 24 '11 08:06

Kris


1 Answers

$('tr.even-row, tr.odd-row')

You can also do

$('.even-row, .odd-row')

If you don't care that it's a tr.

You don't have to pre-mark the rows with an odd/even class. You can also do:

$('tr:odd, tr:even')

And jQuery will figure out which are odd/even on its own.

like image 165
Ariel Avatar answered Oct 21 '22 06:10

Ariel