Javascript DOM HTML Input Range step Property get

Introduction

Display the value of the step attribute of a slider control:

var x = document.getElementById("myRange").step;

Click the button to display the value of the step attribute of the slider control.

View in separate window

<!DOCTYPE html>
<html>
<body>

Points: <input type="range" id="myRange" step="10">

<button onclick="myFunction()">Test</button>
<p id="demo"></p>

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

</body>
</html>



PreviousNext

Related