I am trying to instantiate new HTMLDivElement in TypeScript
var elem = new HTMLDivElement();
but the browser throws
Uncaught T
You have mistaken typescript syntax with c# syntax.
Just replace
var elem = new HTMLDivElement();
with one of the following
var elem = document.createElement('div');
or
var elem = (document.createElement('div'));
or
let elem = document.createElement('div') as HTMLDivElement
(if you need to use HTMLDivElement attributes)