We've created a fake Reset button, and used onclick to run the confirmReset() function. The user sees a confirm box, and if he clicks on OK we use the form's reset method to reset the form. The reset method is the equivalent of clicking the Reset button, so it still runs the onreset event handler. Try changing the text and clicking on Reset. Try both OK and Cancel in the Confirm box.