title: JavaScript (not jQuery) Find class and add new class
body: <p>I am trying to find if a class name exists in a webpage, and then add a new class.</p>
  <p>Testing in Chrome Developer Tools Console I get undefined. What am I doing wrong?</p>
  <p>Code I am using.</p>
  <pre><code>const srtClass = document.querySelectorAll('.sr-only'); 
  srtClass.className += &quot; showoffScreenText&quot;;
  console.log(srtClass);
  </code></pre>
  <p>The results for the console.log</p>
  <blockquote>
  <p>HTMLCollection(2) [span.sr-only, div.sr-only] className: &quot;undefined showoffScreenText&quot;</p>
  </blockquote>
  <p>The sr-only class is found so why is it undefined?</p>