Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to check if an element starts with class in jquery

/*SM*/

//Try using :
$("[class^=info_]"); //Classes Starts with  info_
$('[class*=info_]');  // Classes which contains info_

//instead of hasClass
if($('label').is('[class*=info_]')){} //Contains
//or
 if($('label').is('[class^=info_]')){} //Starts with
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #element #starts #class #jquery
ADD COMMENT
Topic
Name
1+9 =