For whatever reason I have these classes called .main_sub1, .main_sub2 etc. Never mind why I can\'t have .main .sub.
.main_sub1
.main_sub2
.main .sub
Is there
Yes, you can use an attribute selector to match certain values for the class attribute.
class
$('[class^=main]') // class begins with "main" $('[class*=main]') // class contains "main" anywhere within it