can the HTML5 Canvas element be created from the Canvas constructor
Solution 1:
While you can do new Image()
just fine, new Canvas()
isn't a thing! Canvas
Isn't even a thing, though HTMLCanvasElement
is. Nonetheless you cannot use its constructor.
document.createElement('canvas');
is what you want. You have to use that, just like with divs.
Solution 2:
var mycanvas = document.createElement("canvas");
mycanvas.id = "mycanvas";
document.body.appendChild(mycanvas);