title: Get elements with one class but not another without iterating
body: <p>In the following simple HTML, I would like to get <strong>all elements with class1 but not with class2</strong>.</p>
  
  <pre><code>&lt;li class="class1 class2"&gt;&lt;/li&gt;
  &lt;li class="class1 class3"&gt;&lt;/li&gt;
  &lt;li class="class1 class4"&gt;&lt;/li&gt;
  </code></pre>
  
  <p>By using <code>getElementsByClassName('class1')</code> we could get all elements and then possibly remove elements by <a href="https://stackoverflow.com/questions/5898656/test-if-an-element-contains-a-class">checking if a certain class exists</a>.</p>
  
  <p><strong>Is there a better way to do this, without iterating?</strong></p>
  
  <p>I found <a href="https://stackoverflow.com/questions/7184562/javascript-how-to-get-elements-with-multiple-classes">this interesting post</a> about getting elements with multiple classes, so dare I ask: Is there something like this: <code>document.getElementsByClassName("class1 !class2")</code>?</p>
  
  <p>P.S.: I don't want to use jQuery.</p>