April 15, 2020

Javascript and the HTML Canvas

The Canvas appeared with HTML 5 and is now part of all modern browsers. A single line of HTML sets up a canvas, and you write to it from javascript. A style line can include CSS for the canvas, such as:

<canvas id="tutorial" width="150" height="150"> </canvas>
<canvas id="tutorial" width="150" height="150" style="border:1px solid #000000;"> </canvas>
This is pretty much the whole story from the HTML side of things, all the writing to the canvas is done from Javascript.
Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org