Input Range value Property - Get the value of a slider control: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Range

Description

Input Range value Property - Get the value of a slider control:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Points: <input type="range" id="myRange" value="20">

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {/*www .j a  v  a  2 s  . com*/
    var x = document.getElementById("myRange").value;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials