Obiekt resetowania danych wejściowych HTML DOM
Wejście resetowania obiektu
Obiekt Input Reset reprezentuje element HTML <input> z type="reset".
Uzyskaj dostęp do obiektu resetowania wejścia
Możesz uzyskać dostęp do elementu <input> z type="reset" za pomocą getElementById():
Przykład
var x = document.getElementById("myReset");
Wskazówka: możesz również uzyskać dostęp do <input type="reset"> przeszukując kolekcję elementów formularza.
Utwórz obiekt resetowania wejścia
Możesz utworzyć element <input> z type="reset" za pomocą metody document.createElement():
Przykład
var x = document.createElement("INPUT");
x.setAttribute("type", "reset");
Wejście Resetuj właściwości obiektu
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 |
Standardowe właściwości i zdarzenia
Obiekt Input Reset obsługuje również standardowe właściwości i zdarzenia .
Powiązane strony
Samouczek HTML: formularze HTML
Odniesienie HTML: tag HTML <input>
Odniesienie HTML: atrybut typu HTML <input>