A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLFormElement/reset below:

reset ยท WebPlatform Docs

reset

Method of dom/HTMLFormElementdom/HTMLFormElement

Syntax
var 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.

Examples

This 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>

View live example

Notes Remarks

The reset method raises the onreset event on the form. The reset method fires the onreset event on the form.

Syntax Standards information See also Related pages Attributions

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