Javascript examples for DOM HTML Element:Input Range
The max property sets or gets the max attribute of a slider control.
Set the max property with the following Values
Value | Description |
---|---|
number | Sets the maximum value allowed for the slider control |
A String, representing the maximum value allowed
The following code shows how to get the maximum value allowed for a slider control:
<!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 ww w . ja v a 2s . c o m var x = document.getElementById("myRange").max; document.getElementById("demo").innerHTML = x; } </script> </body> </html>