The getMatchingClass plugin is useful for determing whether a singular matching element contains a particular partial class name. The idea behind the function is to allow for partial matching using the following jQuery selectors:
- $= – “ends with” selector
- ^= – “starts with” selector
- *= – “contains” selector
- = – “matches” selector
The plugin is useful in the event you need to determine if an element contains a portion of a class name utilizing already known jQuery selectors. Unfortunately this functionality did not exist within the Sizzle selector engine. Improvements and bugfixes are always welcome.
To reiterate, this plugin is only useful in very specific cases. My initial use case involved handling a lightbox with class variances to allow for complete changes in styling.