Oggetto intervallo di input HTML DOM
Oggetto intervallo di input
L'oggetto Input Range rappresenta un elemento HTML <input> con type="range".
Accedere a un oggetto intervallo di input
Puoi accedere a un elemento <input> con type="range" usando getElementById():
Esempio
var x = document.getElementById("myRange");
Suggerimento: puoi anche accedere a <input type="range"> cercando nella raccolta di elementi di un modulo.
Crea un oggetto intervallo di input
Puoi creare un elemento <input> con type="range" usando il metodo document.createElement():
Esempio
var x = document.createElement("INPUT");
x.setAttribute("type", "range");
Proprietà dell'oggetto intervallo di input
Property | Description |
---|---|
autocomplete | Sets or returns the value of the autocomplete attribute of a slider control |
autofocus | Sets or returns whether a slider control should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a slider control |
disabled | Sets or returns whether a slider control is disabled, or not |
form | Returns a reference to the form that contains the slider control |
list | Returns a reference to the datalist that contains the slider control |
max | Sets or returns the value of the max attribute of the slider control |
min | Sets or returns the value of the min attribute of the slider control |
name | Sets or returns the value of the name attribute of a slider control |
step | Sets or returns the value of the step attribute of the slider control |
type | Returns which type of form element the slider control is |
value | Sets or returns the value of the value attribute of a slider control |
Metodi dell'oggetto dell'intervallo di input
Method | Description |
---|---|
stepDown() | Decrements the value of the slider control by a specified number |
stepUp() | Increments the value of the slider control by a specified number |
Proprietà ed eventi standard
L'oggetto Intervallo di input supporta anche le proprietà e gli eventi standard .
Pagine correlate
Esercitazione HTML: Moduli HTML
Riferimento HTML: tag HTML <input>
Riferimento HTML: attributo tipo HTML <input>