Answers for "JQuery .hasClass for multiple values in an if statement"

0

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

}
Posted by: Guest on November-26-2020
0

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
Posted by: Guest on November-26-2020
0

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');
      }

    });
Posted by: Guest on July-08-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language