HTML Dom Input Range | Input Range | Input Type Range Tutorial by WDH

HTML DOM Input Range Object


 

Example

Change the value of a slider control:

document.getElementById("myRange").value = "75";

Try it yourself »


Definition and Usage

The value property sets or returns the value of the value attribute of a slider control.

The value attribute specifies the default value OR the value a user types in (or a value set by a script).


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The value property is supported in all major browsers.

Note: The <input type="range"> element is not supported in Internet Explorer 9 and earlier versions.


Syntax

Return the value property:

rangeObject.value

Set the value property:

rangeObject.value=number