title: Type casting of HTML Elements
body: <p>I’m trying to get an element using <code>document.querySelector</code> function. </p>
  
  <p>The element is a button, so if I do: </p>
  
  <pre><code>let mybutton: Element = document.querySelector(‘button.ok’);
  mybutton.addEventListener('click', () =&gt; {
      if (mybutton.disabled) 
      // TS linter returns "Property 'disabled' does not exist on Type 'Element'
  </code></pre>
  
  <p>So I can give my <code>button.ok</code> to a HTMLButtonElement:</p>
  
  <pre><code>let mybutton: HTMLButtonElement = document.querySelector('button.ok');
  // TS linter returns "Type 'Element' is not assignable to type 'HTMLButtonElement'."
  </code></pre>
  
  <p>So how can I manage a button and its properties in TS? </p>