Javascript DOM HTML Input Range handle input event

Introduction

This example demonstrates how to dynamically update a slider value with oninput.

View in separate window

<!DOCTYPE html>
<html>
<body>
<input type="range" oninput="myFunction(this.value)">
<p id="demo"></p>
<script>
function myFunction(val) {/*from   w  w  w .j  a  v a2s.  c  o m*/
  document.getElementById("demo").innerHTML = val;
}
</script>

</body>
</html>



PreviousNext

Related