Objekt pro obnovení vstupu HTML DOM
Zadejte objekt Reset
Objekt Input Reset představuje HTML prvek <input> s type="reset".
Přístup k objektu Resetování vstupu
K prvku <input> můžete přistupovat s type="reset" pomocí getElementById():
Příklad
var x = document.getElementById("myReset");
Tip: K <input type="reset"> se dostanete také prohledáváním kolekce prvků formuláře.
Vytvořte objekt pro resetování vstupu
Element <input> můžete vytvořit s type="reset" pomocí metody document.createElement():
Příklad
var x = document.createElement("INPUT");
x.setAttribute("type", "reset");
Zadejte vlastnosti objektu Reset
Property | Description |
---|---|
autofocus | Sets or returns whether a reset button should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a reset button |
disabled | Sets or returns whether the reset button is disabled, or not |
form | Returns a reference to the form that contains the reset button |
name | Sets or returns the value of the name attribute of a reset button |
type | Returns which type of form element the reset button is |
value | Sets or returns the value of the value attribute of the reset button |
Standardní vlastnosti a události
Objekt Input Reset také podporuje standardní vlastnosti a události .
Související stránky
HTML výukový program: HTML formuláře
HTML reference: HTML tag <input>
HTML reference: HTML <input> typ atributu