Reset : Reset « Form « JavaScript Tutorial






The Reset object represents a Reset button within an HTML form.

The button is created using the HTML tag and specifying the TYPE attribute as reset.

Reset buttons are used for form submissions.

Property/MethodDescription
blur()Removes focus from Reset button
click()Simulates a mouse click on a Reset button
focus()Sets the focus to the Reset button
formSpecifies the form name that contains the Reset button
handleEvent()Invokes the event handler
nameHTML NAME attribute for the Reset button
onBlurEvent handler for Blur event
onClickEvent handler for Click event
onFocusEvent handler for Focus event
typeHTML TYPE attribute for the Reset button
valueHTML VALUE attribute for the Reset button


<html>
    <head>
    <title> Example of the reset object</title>
    </head>
    <body>
    <form name="form1">
    Click the Reset button to reset the form.
    <br><br><br>
    Enter Name: <input type="text" Name="name" Size=15>
    <br>
    Enter Phone: <input type="text" Name="phone" Size=10>
    <br><br>
    <input type="reset" name=resetbutton value=Reset>
    <br>
    <br>
    </form>
    </body>
    </html>








10.25.Reset
10.25.1.Reset
10.25.2.Reset.blur()
10.25.3.Reset.click()
10.25.4.Reset.focus()
10.25.5.Reset.form
10.25.6.Reset.handleEvent()
10.25.7.Reset.name
10.25.8.Reset.onBlur
10.25.9.Reset.onClick
10.25.10.Reset.onFocus
10.25.11.Reset.type
10.25.12.Reset.value
10.25.13.Resetting a form on page load