EDITABLE CODE:
LiveDemo: HTML5 Canvas Clear Rectangle
Exercise-Try clearRect(x,y,w,h) with different values, notice the difference.