Javascript DOM HTML Input Range value Property set

Introduction

Change the value of a slider control:

document.getElementById("myRange").value = "75";

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

View in separate window

<!DOCTYPE html>
<html>
<body>

<input type="range" id="myRange">
<button onclick="myFunction()">Test</button>
<p id="demo"></p>

<script>
function myFunction() {//w ww.j a v  a  2s  .  c  o  m
  document.getElementById("myRange").value = "75";
}
</script>

</body>
</html>

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

The value property accepts and returns a number type value.




PreviousNext

Related