I got several divs using classes like
- .wrap-1-addon-1
- .wrap-2-addon-1
- .wrap-3-addon-1
I want to select all of them and use if ( $(this).hasClass() ) to check if its one of them. Currently I only do check for a single class. How can I check all of these, for example .hasClass('wrap-*-addon-1')?
Best regards.
<div class="wrap wrap-1-addon-1"></div><div class="wrap wrap-2-addon-1"></div>and simply target thewrap. Not sure how many of these are possible in your system but wildcards and regex will make your app sluggish at some point and hardcoding every possible combination would be insanity.