I have the following structure of div tags and each div tag has multiple classes like :-
<div>
<div class="jsh-a_train_hotel_amsterdam info js-multiple"></div>
<div class="jsh-info info js-multiple"></div>
<div class="jsh-myinfo info js-single"></div>
</div>
Now I want to find div tags which have class name starting with "jsh-" and also the class that starts with "jsh-" should have a substring "info" in it.
So the result should be the following :-
<div class="jsh-info info js-multiple"></div>
<div class="jsh-myinfo info js-single"></div>
(Reason: Because the above 2 div tags have classes jsh-info and jsh-myinfo which satisfies the condition that the element class name should have "jsh-" and the substring in the "jsh-" class name value should have string "info" in it)
divsfor one scenario, e.g.jsh-selectand use one function to distinct its purpose, e.g.hasClass("info"). The given answers are correct but your requirements make it far to irregular to create a standard ..