Trying to instantiate an HTMLElement extended class in native JavaScript

Viewed 1300

I know we can use
const a = document.createElement('a').

But what I'm trying is
const a = new HTMLAnchorElement()

However this will throw the following Exception :
Uncaught TypeError: Illegal constructor

What am I doing wrong ?

0 Answers
Related