title: How to Instantiate new HTMLElement?
body: <p>I am trying to instantiate new HTMLDivElement in TypeScript</p>
  
  <pre><code>var elem = new HTMLDivElement();
  </code></pre>
  
  <p>but the browser throws </p>
  
  <pre><code>Uncaught TypeError: Illegal constructor.
  </code></pre>
  
  <p>The workaround seems to be to use </p>
  
  <pre><code>var elem = document.createElement('div');
  </code></pre>
  
  <p>but I find this suboptimal for various reasons. </p>
  
  <p>Why can't I instantiate DOM elements directly when there is a <strong>new</strong> keyword for in in the <strong>lib.d.ts</strong>?</p>
  
  <pre><code>declare var HTMLDivElement: {
      prototype: HTMLDivElement;
      new (): HTMLDivElement;
  }
  </code></pre>