The range state represents a control for setting the element's value to a string representing a number.
- In this state, the range and step constraints are enforced even during user input, and there is no way to set the value to the empty string.
- The value attribute, if specified, must have a value that is a valid floating point number.
autocomplete= on/ off/ defult
The on state indicates that the value is not particularly sensitive and the user can expect to be able to rely on his user agent to remember values he has entered for that control.
The off state indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.
The default state indicates that the user agent is to use the autocomplete attribute on the element's form owner instead. (By default, the autocomplete attribute of form elements is in the on state.)
list= ID reference
Identify an element that lists predefined options suggested to the user.
If present, its value must be the ID of a datalist element in the same document.
max= valid floating point number
indicate the allowed range of values for the element. The default maximum is 100.
min= valid floating point number
indicate the allowed range of values for the element.
Gives the name of the input element.
Controls whether or not the user can edit the form control.
When specified, the element is required.
step= any/ positive floating-point number
Specifies the value granularity of the element’s value.
Gives the default value of the input element.
Here is an example of a range control using an autocomplete list with the list attribute [try it]
<input type="range" min="-100" max="100" value="0" step="10" name="power" list="powers"> <datalist id="powers"> <option value="0"> <option value="-30"> <option value="30"> <option value="+50"> </datalist>
The HTML5 specification defines the Range state in 188.8.131.52.14 RANGE STATE.