My js Code
if ($("#fb_connect_sell,#fb_connect").hasClass("connected")){
}
how i can use multiple selector with single hasclass?
My js Code
if ($("#fb_connect_sell,#fb_connect").hasClass("connected")){
}
how i can use multiple selector with single hasclass?
If you want to check whether one of the elements has the class then use .is()
if ($("#fb_connect_sell,#fb_connect").is(".connected")){
}
if you want to check whether both has the class
if ($("#fb_connect_sell,#fb_connect").filter(".connected").length){
}
try
var $first = $("#fb_connect_sell");
var $second = $("#fb_connect");
if ($html.hasClass('connected') && $html.hasClass('connected')) {
// do stuff
}