HTML DOM Input Reset objekt

Input Reset object

The Input Reset object represents the HTML <input> element that has been set to type="reset".

Access Input Reset object

You can access the <input> element with type="reset" using getElementById():

var x = document.getElementById("myReset");

Try it yourself

Hint:You can also search the form for elements collection to access <input type="reset">.

Create Input Reset object

You can create an <input> element with type="reset" using the document.createElement() method:

var x = document.createElement("INPUT");
x.setAttribute("type", "reset");

Try it yourself

Input Reset object properties

properties Description
autofocus Set or return whether the reset button should automatically focus when the page is loaded.
defaultValue Set or return the default value of the reset button.
disabled Set or return whether the reset button is disabled.
form Return a reference to the form that contains the reset button.
name Set or return the name attribute value of the reset button.
type Return which type of form element the reset button is.
value Set or return the value of the value property of the reset button.

standard properties and events

Input Reset object supports both standardspropertiesandevents.

related pages

HTML tutorial:HTML formular

HTML reference manual:HTML <input> tag

HTML reference manual:HTML <input> type egenskab