This is another one from the frequently asked questions basket. The getMousePosition script supplied here takes an event as it's parameter and returns an object with the attributes x & y set to the position of the mouse. You've probably already noticed it updating the input below.
Mouse Position :
Here's the code that's doing the work. The getMousePosition function returns the mouse position of the supplied event object. The showMousePos function grabs the mouse position and then updates the input so we can see it. The init function just adds a handler for the mousemove event.