title: Get HTMLElement from Element
body: <p>I have an <code>Element</code>, and I can not figure out how to get the <code>HTMLElement</code> from it.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;a href=""&gt;A link&lt;/a&gt;
  &lt;a href=""&gt;Another link&lt;/a&gt;
  </code></pre>
  
  <p>I then get them like so:</p>
  
  <pre><code>var nodes: NodeListOf&lt;Element&gt; = document.querySelectorAll('a'); // Returns a NodeList of Elements
  for (let i = 0; i &lt; nodes.length; i++) {
      var node = nodes.item(i);
      // How can I get the HTMLElement here?
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ofD6A.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ofD6A.png" alt="enter image description here"></a></p>
  
  <p>Here is the code:</p>
  
  <pre><code>let nodes: NodeListOf&lt;Element&gt; = document.querySelectorAll('a');
  for (let i = 0; nodes[i]; i++) {
      let node = nodes[i];
      var c = nodes[i].style.backgroundColor = 'red';
  }
  </code></pre>