jQuery selector AND operator

css-selectors, javascript, jquery

Solution

Why not do:

$('table.cp-ss-grid > tbody > tr:odd');

To explicitly select the body rows? All browsers will add a tbody for you if you don't have one.

Problem

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?

Original source