title: Converting Element to HTMLElement in javascript / typescript
body: <p>So, I'm getting a list of elements that match a selector using querySelectorAll, which stores them in a NodeList.</p>
  
  <p>I'm then scanning through the NodeList with a forEach loop, at which point the type of each individualItem is "Element". </p>
  
  <p>However, I'm feeding these individualItems into a function "doThing()" that expects individualItem to be of type "HTMLElement" (I'm using typescript). I'm wondering if there is some built in js function for converting an "Element" type into an "HTMLElement" type, or, if not, what a function like that might looks like</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const h = document.querySelectorAll(someClassString);
  
  h.forEach(individualItem =&gt; {
              individualItem.addEventListener(c.EVENT, () =&gt; doThing(individualItem));
  })    </code></pre>
  </div>
  </div>
  </p>