Sketchpad in JavaScript from scratch

In this article we will be building a simple sketch pad application in JavaScript from scratch. It will have a brush and eraser with variable size. For simplicity, lets limit it to draw and erase. The finished application can be viewed here.

The requirements for this application are basic knowledge of html and JavaScript.