I came across an interesting scenario the other day where I needed to select some html elements with JQuery that had a class name like:
1: <input type="radio" class="star star_id_45 star_group_5" />
I wanted to be able to select the elements that contained the class ‘star_id_45’, which as you can see is in the middle of the class string.
The answer was the following code:
1: $("input[class*='star_id_45']")
Notice the use of the asterix (*), that was the key to getting the selector to work properly.