Javascript DOM HTML Input Range stepDown() Method with default value

Introduction

Decrement the value of a slider control by "1" (default):

document.getElementById("myRange").stepDown();

Click the button to decrement the value of the slider control by "1".

View in separate window

<!DOCTYPE html>
<html>
<body>

Points: <input type="range" id="myRange" value="60">

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

<script>
function myFunction() {//from  w  ww  . jav a 2  s .  c o  m
  document.getElementById("myRange").stepDown();
}
</script>

</body>
</html>



PreviousNext

Related