Demo:

Erasing shapes on an HTML Canvas

Please note: this demo page is to go along with the post HTML5 Canvas: Erasing shapes, so please use that for reference.

Erasing various shape types from a Canvas

Erasing lines

Erasing rectangles

Erasing more complex shapes