To check and find the existing class name of an element inside HTML by jQuery you can use hasClass().
if($('#elm').hasClass('classname')) { ? //Do whatever you want
} else { //Do whatever you want }
Read articles from tech expert
To check and find the existing class name of an element inside HTML by jQuery you can use hasClass().
if($('#elm').hasClass('classname')) { ? //Do whatever you want
} else { //Do whatever you want }