www.ethernex.net/projects/html5/graphics.html
This is probably the most simple example of canvas animation in html5. I hate when people post so called "example code" to show off while their code is overly-complicated and a terrible example. This example can be used as a basic building block in understanding core sections and graphics of javascript and html5 and can be added onto easily.
www.ethernex.net/projects/html5/polygon.html This was my very first html5 canvas page. It explores the drawing usages of .moveto(x,y) and .lineto(x,y). Moveto( ) is what should be used first to make the start point. Then, one can specify coordinates of any other point that you would like line to be drawn to. I forget off-hand if it is necessary to have the last point to be the start coordinates, but I would assume it would be good practice.