can the HTML5 Canvas element be created from the Canvas constructor

后端 未结 2 859
感情败类
感情败类 2021-02-03 17:32

I would like to be able to make Canvas elements from the constructor so that I could make a function like this.

function createCanvasContext(height,width)
{
   v         


        
2条回答
  •  花落未央
    2021-02-03 17:54

    var mycanvas = document.createElement("canvas");
    mycanvas.id = "mycanvas";
    document.body.appendChild(mycanvas);
    

提交回复
热议问题