title: How can I check in JavaScript if a DOM element contains a class?
body: <p>How can I check in JavaScript if a DOM element contains a class?</p>
  
  <p>I tried the following code, but for some reason it doesn't work...</p>
  
  <pre><code>if (document.getElementById('element').class == "class_one") {
      //code...
  }
  </code></pre>