how can i change the size of an html canvas through a function? i tried Width=123;" and
canvas.style.Width=123 canvas.width=123 neither of them worked heres the HTML code for the canvas <CANVAS id="canvas" width="460px" height="800px"></CANVAS> and in the css canvasarea { width: 460px; height: 800px;
how can i change the size of an html canvas through a function? i
Share
the
<canvas>element supports thewidthattribute.example:
<canvas width="123"></canvas>to change the width with javascript do something like:
reference: http://www.w3schools.com/html5/tag_canvas.asp