jQuery element with multiple classes
$('.class1.class2') // select element that has both class1 and class2
jQuery element with multiple classes
$('.class1.class2') // select element that has both class1 and class2
jquery multiple classes
$(".intro, .demo, .end")
jQuery hasClass() - check for more than one class
element.is('.class1, .class2')
// works, but it's 35% slower than
element.hasClass('class1') || element.hasClass('class2')
//https://stackoverflow.com/questions/2214952/jquery-hasclass-check-for-more-than-one-class
jquery hasclass multiple classes
jQuery('button').click(function(){
var hcls =jQuery('p').hasClass('class2').addClass('class2');
if(hcls == true){
alert('Yuor class is remove ');
}
else{
alert('your class is nnot remove');
}
});
JQuery .hasClass for multiple values in an if statement
if ($('html').is('.m320, .m768')) { ... }
//https://stackoverflow.com/questions/10559153/jquery-hasclass-for-multiple-values-in-an-if-statement
JQuery .hasClass for multiple values in an if statement
var $html = $("html");
if ($html.hasClass('m320') || $html.hasClass('m768')) {
// do stuff
// https://stackoverflow.com/questions/10559153/jquery-hasclass-for-multiple-values-in-an-if-statement
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us