title: Vanilla JavaScript - Syntax for adding class to element with specific data attr
body: <p>Trying to add a class to an element with a specific data attribute.</p>
  
  <p>The element is: <code>&lt;a data-type="foo"&gt;Linkypoo&lt;/a&gt;</code></p>
  
  <p>I am trying to target like so: </p>
  
  <pre><code>document.querySelectorAll('[data-type="foo"]').classList.add('Booya');
  </code></pre>
  
  <p>but I am getting the error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'add' of undefined</p>
  </blockquote>
  
  <p>Could someone point me in the right direction. Not sure how to do this with vanilla js.</p>
  
  <p>Thank you :)</p>