411 REFERENCE · Wikibooks
HyperText Markup Language/Canvas
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
The <canvas> tag allows for scriptable rendering of 2D shapes. While a canvas is embedded in an HTML page, it can be rendered with JavaScript.
Rendering a Canvas:
<canvas id="e">This text will be displayed if the browser does not support canvas.</canvas>
JavaScript
var Canvas=document.getElementById("e");
var context=Canvas.getContext("2d");
context.fillStyle="green";
context.fillRect(30,40,30,20);
context.strokeStyle="red";
context.strokeRect(30,40,30,20);
context.strokeText("Hello",30,40);
context.fillText("World",30,50);