Wednesday, July 20, 2011

4.8.11 The canvas element — HTML Standard

4.8.11 The canvas element — HTML Standard: "// canvas is a reference to a element
var context = canvas.getContext('2d');
context.fillRect(0,0,50,50);
canvas.setAttribute('width', '300'); // clears the canvas
context.fillRect(0,100,50,50);
canvas.width = canvas.width; // clears the canvas
context.fillRect(100,0,50,50); // only this square remains"