title: JQuery .hasClass for multiple values in an if statement
body: <p>I have a simple if statement as such:</p>
  
  <pre><code>if ($('html').hasClass('m320')) {
  
  // do stuff 
  
  }
  </code></pre>
  
  <p>This works as expected. However, I want to add more classes to the <code>if statement</code> to check if any of the classes are present in the <code>&lt;html&gt;</code> tag. I need it so it's not all of them but just the presence of at least one class but it can be more. </p>
  
  <p>My use case is that I have classes (e.g. <code>m320</code>, <code>m768</code>) added for various viewport widths so I only want to execute certain Jquery if it's a specific width (class).</p>
  
  <p>Here is what i have tried so far:</p>
  
  <p>1.</p>
  
  <pre><code>if ($('html').hasClass('m320', 'm768')) {
  
  // do stuff 
  
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>if ($('html').hasClass('m320')) || ($('html').hasClass('m768')) {
  
   // do stuff 
  
  }
  </code></pre>
  
  <p>3.</p>
  
  <pre><code> if ($('html').hasClass(['m320', 'm768'])) {
  
   // do stuff 
  
      }
  </code></pre>
  
  <p>None of these seem to work though. Not sure what I am doing wrong but most likely my syntax or structure. </p>