title: How to get all Child Elements with specific attribute in JavaScript
body: <p>I have an object that was retrieved from this expression:</p>
  
  <pre><code>const element = document.querySelector("...my selector...");
  </code></pre>
  
  <p>I need to get all child elements that have certain attributes, The only way I know to get all children is by:</p>
  
  <pre><code>const children = Array.from(element.childNodes);
  </code></pre>
  
  <p>but now each <code>child</code> in <code>children</code> is not an <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element" rel="nofollow noreferrer">element</a>, rather a <a href="https://developer.mozilla.org/en-US/docs/Web/API/Node" rel="nofollow noreferrer">node</a>, hence, I cannot use <code>getAttribute('')</code> on them;</p>
  
  <p>How do I "cast" a <code>Node</code> to an <code>Element</code>?, Or is there a better way to do this?</p>