JavaScript Examples


onMouseUp & onMouseDown



The MouseDown event is triggered when the user presses a mouse button.

The MouseUp event is triggered when the user releases a mouse button.

The button label is stored in the document.formname.fieldname.value property where the formname is replaced by name defined in the <form> tag‚ and the fieldname is replaced by name defined in the <input> tag for a particular button. The value property can be replaced by the value defined in the <input> tag or assigned in the function.


Adapted from:

Book: QuickStart to JavaScript
Publisher: Scott/Jones, Inc.
Chapter: 3
Page: 71
Adaptations by: R. Hinton