Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery selector AND operator

This may sound like a simple question, but I just cannot seem to find an answer on google, probably because the search term will bring back quite a lot of irrelevance.

I would like a jQuery selector to select all odd table rows, that are not in <thead> and apply a css class to them all.

table.cp-ss-grid tr:odd

The above selector will bring back all odd rows in the table correctly, but will include the thead rows (on ie)

How would I in the selector do an and, i.e. something like:

table.cp-ss-grid tr:odd:not(thead)

the above doesn't work and still brings back the thead rows

Any ideas?

like image 294
Gunner Avatar asked Jun 26 '09 08:06

Gunner


1 Answers

An AND selector for jQuery would be for example: .classA.classB

This would select elements which have classA and classB.

like image 124
Andreas Avatar answered Sep 23 '22 22:09

Andreas