Javascript DOM HTML Input Range max Property set

Introduction

Change the maximum value:

document.getElementById("myRange").max = "90";

Click the button to change the value of the max attribute of the slider control.

View 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   ww w.  j  a v  a 2  s. c om*/
  var x = document.getElementById("myRange").max = "90";
  document.getElementById("demo").innerHTML = "The value of the max attribute was changed.";
}
</script>

</body>
</html>



PreviousNext

Related