Method of dom/HTMLFormElementdom/HTMLFormElement
Syntaxvar object = object.reset();
Return Value
Returns an object of type DOM NodeDOM Node
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
ExamplesThis example demonstrates how to use the reset method for a form object. When the button is pressed, the form is reset, resulting in the onreset event call on the form object. The onreset event calls an event handler which in turn adds the text Resetting form.
to the text area below.
<HTML>
<HEAD>
<SCRIPT>
function doReset(){
oTextArea1.value += "Resetting form. ";
}
</SCRIPT>
</HEAD>
<BODY>
<DIV id="oDiv1"
style="border:1px solid black; background:#EEEEEE; padding:10px;">
<B>Form</B>
<FORM name="form1" onreset="doReset();">
<b>Enter some text:</b> <INPUT type="text" name="oText1" value=""><BR><BR>
<BUTTON onclick="form.reset();">form.reset()</BUTTON>
</FORM>
</DIV>
<B>Text area</B><BR>
<TEXTAREA id="oTextArea1" value="" rows="5" cols="75"></TEXTAREA>
</BODY>
</HTML>
Notes Remarks
The reset method raises the onreset event on the form. The reset method fires the onreset event on the form.
Syntax Standards informationform
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4