Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Range Object

HTML DOM Input Range Object


Input Range Object

The Input Range object is new in HTML5.

The Input Range object represents an HTML element using the type="range" attribute .

Note: Internet Explorer 9 and earlier versions do not support the HTML using the type="range" attribute .

Accessing the Input Range Object

You can use the getElementById() function to access the one using the type="range" attribute element:

var x = document.getElementById("myRange");

Try it

Tip: You can also access the Input Color object through a form'sElementcollection to access the Input Range object.

Creating the Input Range Object

You can use the document.createElement() method to create the one using the type="range" attribute element:

var x = document.createElement("INPUT");

x.setAttribute("type", "range");

Try it

Input Range Object Properties

property Description
autocomplete Sets or returns the value of the autocomplete attribute of the slider control
autofocus Sets or returns whether the slider control automatically gets focus after the page loads
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 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 the slider control
step Sets or returns the value of the step attribute of the slider control
type Returns the form type of the slider control
value Sets or returns the value of the value attribute of the slider control

Standard properties and events

The Input Range object also supports the standard property and Events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML tag

HTML Reference Manual: HTML type Attribute