JAVASCRIPT

 Home  Computers & Internet  Web Programming JAVASCRIPT
What is Javascript?
Javascript Placement
Syntax
Reserved Words
Variables
Data Types
Escaping Characters
Concatenation
Arithmetic Operators
Assignment Operators
Comparison Operators
Boolean Operators
Conditional Operator
If Statements
Else If Statements
If Else Statements
Switch Statements
While Loops
For Loops
Do While Loops
Break Statement
Continue Statement
prompt()
alert()
Date()
Event Handlers
String Object Methods
Math Object Methods
Window Object Methods
Arrays

JAVASCRIPT ONRESET EVENT

The javascript onreset event handler is used to trigger a script or action when a form is reset. The onreset event calls the action from the <form> element.

Example:

<form action="#" method="post" onreset="alert('You have resetted this form');">
<input type="text" ><br>
<input type="submit" value="submit" >
<input type="reset" value="reset" >
</form>

The above example will output You have resetted this form when you press the reset button.

The onreset event can also call a function as follows:

<head>

<script type="text/javascript">

function resetme ()
{
alert('You have resetted this form');
}

</script>

</head>

<body>

<form action="#" method="post" onreset="resetme()">
<input type="text" ><br>
<input type="submit" value="submit" >
<input type="reset" value="reset" >
</form>

DEMO:

Click the reset button below to see the effect.




See also:

onload
onunload
onclick
ondblclick
onmousedown
onmouseup
onmouseover
onmousemove
onmouseout
onkeypress
onkeydown
onkeyup
onfocus
onblur
onsubmit
onselect
onchange


Home | Privacy Policy | Terms Of Use | Contact Us