1element.is('.class1, .class2')
2// works, but it's 35% slower than
3
4element.hasClass('class1') || element.hasClass('class2')
5
6//https://stackoverflow.com/questions/2214952/jquery-hasclass-check-for-more-than-one-class
1jQuery('button').click(function(){
2
3 var hcls =jQuery('p').hasClass('class2').addClass('class2');
4
5 if(hcls == true){
6
7 alert('Yuor class is remove ');
8 }
9 else{
10
11 alert('your class is nnot remove');
12 }
13
14 });
1var $html = $("html");
2
3if ($html.hasClass('m320') || $html.hasClass('m768')) {
4
5 // do stuff
6 // https://stackoverflow.com/questions/10559153/jquery-hasclass-for-multiple-values-in-an-if-statement
7
8}
9
1if ($('html').is('.m320, .m768')) { ... }
2//https://stackoverflow.com/questions/10559153/jquery-hasclass-for-multiple-values-in-an-if-statement
3