Creating a canvas element and setting its width and height attributes using jQuery

后端 未结 6 1761
天涯浪人
天涯浪人 2020-12-16 09:55

I was just trying to do the following in jQuery:

var newCanvas = $(\'\',{\'width\':100,\'height\':200,\'class\':\'radHuh\'});
$(body).append(n         


        
6条回答
  •  一个人的身影
    2020-12-16 10:38

    var newCanvas = $('',{
                       'class':'radHuh',
                        id: 'myCanvas'                   
                    }).prop({
                        width: 200,
                        height: 200
                    });
    $('#canvas').append(newCanvas);
    

    Proof

提交回复
热议问题