X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Input Range value Property

Input Range Object Reference 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

Property Values

Value Description
number Specifies the initial (default) value of the slider control. If the value is not specified, the default value is "50"

Technical Details

Return Value: A String, representing a number that represents the default value of the slider control


More Examples

Example

Get the value of a slider control:

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

The result of x will be:

50

Try it yourself »


Related Pages

HTML reference: HTML <input> value attribute


Input Range Object Reference Input Range Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook