Create HTML5 Canvas programmatically

var canvas = document.createElement("canvas");
canvas.className  = "myClass";
canvas.id = "myId";
document.getElementsByTagName('body')[0].appendChild(canvas);