<input> - range
HTML DOM Input Range object
Input Range object
The Input Range object is new to HTML5.
An Input Range object represents an HTML <input> element using the type="range" attribute.
Note: Internet Explorer 9 and earlier versions of IE do not support HTML <input> elements with the type="range" attribute.
Access the Input Range object
You can use the getElementById() function to access <input> elements with the type="range" attribute:
var x = document.getElementById("myRange");
Tip: You can also access the Input Range object through the form's elements collection.
Create an Input Range object
You can use the document.createElement() method to create <input> elements with the type="range" attribute:
var x = document.createElement("INPUT");
x.setAttribute("type", "range");
Input Range Object Attributes
Attribute | Description |
---|---|
autocomplete | Sets or returns the value of the autocomplete property of the slider control |
autofocus | Sets or returns whether the slider control automatically gets focus after page load |
defaultValue | Sets or returns the default value of the slider control |
disabled | Sets or returns whether the slider control is available |
form | Returns a reference to the form that uses the slider control |
list | Returns a reference to the datalist containing the slider control |
max | Sets or returns the max property value of the slider control |
min | Sets or returns the value of the slider control's min property |
name | Sets or returns the value of the slider control's name property |
step | Sets or returns the value of the step property of the slider control |
type | Returns the form type of the slider control |
value | Sets or returns the value of the slider control's value property |
Standard Properties and Events
Input Range objects also support standard properties and events .
Related articles
HTML Tutorial: HTML Forms
HTML Reference Manual: HTML <input> Tag
HTML Reference Manual: HTML <input> type attribute