title: querySelector to find label in pure JS
body: <p>Strictly using JS, I want to select a <code>label</code> element and add a class.</p>
  
  <pre><code>document.querySelector('[for=foobar]').className = "foo";
  </code></pre>
  
  <p>What should go in the <code>querySelector</code> to find <code>&lt;label for="foobar"&gt;</code>?</p>
  
  <p>The error I'm getting is <strong>Uncaught SyntaxError: Failed to execute query: '[for=foobar]' is not a valid selector.</strong></p>
  
  <hr>
  
  <p>Ok, I actually solved it by adding quotes around <code>foobar</code>, so it reads:</p>
  
  <pre><code>document.querySelector('[for="foobar"]').className = "foo";
  </code></pre>