showing results for - "jquery hasclass for multiple values in an if statement"
Tim
09 Mar 2019
1if ($('html').is('.m320, .m768')) { ... }
2//https://stackoverflow.com/questions/10559153/jquery-hasclass-for-multiple-values-in-an-if-statement
3
Louisa
28 Jan 2016
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
Matys
04 May 2018
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    });
queries leading to this page
jquery check multiple class with same name existscheck multiple class in jqueryjquery hasclass 28 29 check for more than one classget a class from multiple class jqueryjquery hasclass arrayjquery has one of classesfind element with multiple classes jqueryelement that has two classes jqueryjquery has class arrayhasclass check with multiple idcheck for multiple classes jquerymultiple class inside check has class in jqueryjquery find element that has two classeshasclass jquery multiple classesget single class name from multiple class in jqueryif multiple has class jqueryif 2 classes has class jqueryget multiple class name jqueryjquery has class multiple classesjquery hasclass multipleif class has 2 classes in jquery checkjquery if one of each have classjquery hasclass multiple classesjquery find multiple element addclassjquery selector multiple classfind multiple classes jqueryif multiple exists in class jquerycheck if jquery hasclass multiple classesjquery get class of element with multiple classesuse same multiple class name in jquery run individualdetect classname in jquery with multiple classjquery check how many classes inside a classjquery hasclass one or twojquery check if element has 2 classesjqeru has class multiple classesjquery has multiple classesjquery selector by multiple classjquery element has one of classes arrayfind multiple classesin jqueryjquery has many classfind multiple class name jqueryhas class jquery 2aget multiple classes jqueryif one element having multiple class how to get read those classes in jquerycheck if element has two classes jqueryhow to check multiple classes in jqueryhas two classes jquery checkjquery hasclass multiple selectorsif hasclass 28 29 has two classjquery to check has two classjquery find multiple classesmultiple classes in jquery selectorjs hasclass 2 classesselect if an element has two class name jqueryhow to get element with multiple classes in jqueryjquery if element has multiple classeshas multiple class jqueryjquery hasclass multiple class namesjquery has class check multiple classcheck has class 2 class jqueryjquery check if has multiple classescheck has multiple class jqueryhas multiple classes jquerymultiple class in jquerycheck if div contains more any two class using jquery with or hasclass jquery twojquery if has multiple classesjqwuery hasclass on multiple elementsjquery to check multiple class on a divhas class multiple jqueryhasclass multiple jquerymultiple class selector jqueryjquery check if element has multiple classeshasclass multiple classes jqueryjquery hasclass multiple class selectorsjquery has two classesjquery multiple hasclassjquery hasclass multiple variablesmultiple class use in jquery selectorjquery multiple has classjquery has class multiplejquery hasclass for multiple values in an if statementstackoverflow jquery hasclassmultiple classes in selector jquerymultiple classes selector jqueryjquery check multiple hasclassjquery if has one of multiple classesjquery find with multiple classescheck if has two classes jqueryjquery hasclass 2 classesjquery hasclass check for multiple classesjquery hasclass with multiple class namesjquery hasclass for multiple values in an if statement