Input Range min Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Range

Description

The min property sets or gets the min attribute of a slider control.

Set the min property with the following Values

Value Description
number Sets the minimum value allowed for the slider control

Return Value

A String, representing the minimum value allowed

The following code shows how to get the minimum value allowed for a slider control:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Points: <input type="range" id="myRange" min="25" max="75">

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

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

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

</body>
</html>

Related Tutorials