Get Input Range Field - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Range


The Input Range object represents an HTML <input> element with type="range".

You can access an <input> element with type="range" by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<input type="range" id="myRange" value="90">

<button onclick="myFunction()">get the value of the slider control</button>

<p id="demo"></p>

function myFunction() {/*  w  ww  .j av  a  2 s . c  om*/
    var x = document.getElementById("myRange").value;
    document.getElementById("demo").innerHTML = x;


Related Tutorials