Drawing with mouse events

Point the mouse inside the box below. Hold down the left mouse button and move the mouse. This should draw a line. You can release the button to move the mouse without drawing.

I picked up this bit of html, css and script from the web (*) because I want to explore using the basic idea to make my web pages more interactive. For example, my Julia page on curves, "LuxorCurves.html", could use it to explore the shapes you can make with the code for Bezier curves. Perhaps the left click can move control point 1 and the right click control point 2?

The code for right click is quite complicated. See this discussion: Right Mouse Events

* The url I copied the code from is here: Mouse Events

As a side issue, this could be part of a course for the code club children using javascript?