jquery multiple selectors with AND OR condition

html, javascript, jquery, jquery-selectors

Solution

Try this:

$('.a, .b, .c').filter('.d, .e').filter('.a, .g')

Problem

If I have a table which has 4000 rows ``` <table> <tr class="a b c d e f g"><td>xxx</td></tr> <tr class="a c d e f g"><td>xxx</td></tr> <tr class="d e f g"><td>xxx</td></tr> <tr class="a d e f g"><td>xxx</td></tr> . . . . . </table> ``` If I want to select rows which have classes (a or b or c) and (d or e) and (a or g) How can I code the selector statement? Thanks

Original source