how to check if an element starts with class in jquery

Solutions on MaxInterview for how to check if an element starts with class in jquery by the best coders in the world

showing results for - "how to check if an element starts with class in jquery"
Giulia
21 Sep 2016
1/*SM*/
2
3//Try using :
4$("[class^=info_]"); //Classes Starts with  info_
5$('[class*=info_]');  // Classes which contains info_
6
7//instead of hasClass
8if($('label').is('[class*=info_]')){} //Contains
9//or
10 if($('label').is('[class^=info_]')){} //Starts with