title: Argument of type 'Element' is not assignable to parameter of type 'HTMLElement'
body: <pre class="lang-js prettyprint-override"><code>const labelEl: HTMLElement = document.createElement('label')
  const isElOfNeededType = (el: HTMLElement): boolean =&gt;
      ["INPUT", "TEXTAREA"].includes(el.tagName);
  
  let result
  
  if (isElOfNeededType(labelEl.nextElementSibling)) {
      result = true
  }
  </code></pre>
  
  <p>Here's my playground: <a href="https://typescript-play.js.org/?target=99#code/MYewdgzgLgBANgQwEYFM4FE4C4YAkAqAsgDKYoC2KYsAvDACYjACul1AdMAE4oJQpk2UABQByRKjiiAlAChQkWAEsImAPIAzAHIoU9PfgCeABxQw6wtDgIlBVKNJxIQIOLzDmAfLJi+YAbQAiAEktAAUAVXxAgBoYQPx0AA18AEEAJXRUwIBddiUwYDhmfQhLOHYoBABzLQRKaQBuWVk3WB4IZjgoFqUNGGEVdW1dfXojU2EJNEx2MBQADyg7agBlJSQ4AurpaRgAbx8-Dq7aGCguZhRZAF8gA" rel="nofollow noreferrer">link</a>  </p>
  
  <ol>
  <li>Why am I getting this error on <code>labelEl.nextElementSibling</code>?
  
  <blockquote>
    <p>Argument of type 'Element' is not assignable to parameter of type 'HTMLElement'    </p>
  </blockquote></li>
  </ol>
  
  <p>Doesn't <code>HTMLElement</code> extend <code>Element</code>?  </p>
  
  <p><em>2. (not really important, but would be glad if explained)</em> Why does TS playground complains about <code>[ ].includes</code> whereas I've set <code>Config -&gt; Target = esnext</code> ?</p>