Reputation: 1582
See below code. How do I specify a width and height within these lines?
Specifying a width and height using css does not work.
wrapper.append(
$('<canvas />', { class: 'canvasClass', id: 'cElement' })
);
Upvotes: 2
Views: 44
Reputation: 513
You can also use below code:
$('.canvasClass').width(500).height(300);
Upvotes: 1
Reputation: 67207
since canvas accepts width
and height
attribute
Try to use,
wrapper.append(
$('<canvas />', { class: 'canvasClass', id: 'cElement' ,width:200, height:200 })
);
Upvotes: 3