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

后端 未结 6 1752
天涯浪人
天涯浪人 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条回答
  •  萌比男神i
    2020-12-16 10:25

    I found that this worked the best:

    $('')
    

    You can also add id, class, or other attributes this way. Because it is not in the style="" attribute, it does not count as CSS and mess up your shapes.

提交回复
热议问题