Объект сброса ввода HTML DOM
Объект сброса ввода
Объект Input Reset представляет элемент HTML <input> с type="reset".
Доступ к объекту сброса ввода
Вы можете получить доступ к элементу <input> с type="reset" с помощью getElementById():
Пример
var x = document.getElementById("myReset");
Совет: Вы также можете получить доступ к <input type="reset">, выполнив поиск в коллекции элементов формы.
Создайте объект сброса ввода
Вы можете создать элемент <input> с type="reset" с помощью метода document.createElement():
Пример
var x = document.createElement("INPUT");
x.setAttribute("type", "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 |
Стандартные свойства и события
Объект Input Reset также поддерживает стандартные свойства и события .
Связанные страницы
Учебник по HTML: HTML-формы
Справочник по HTML: HTML-тег <input>
Справочник по HTML: HTML-атрибут типа <input>