Javascript DOM HTML Input Range disable and enable

Introduction

Disable and enable a slider control:

View in separate window

<!DOCTYPE html>
<html>
<body>

<input type="range" id="myRange"><br><br>

<button onclick="disableBtn()">Disable Slider Control</button>
<button onclick="enableBtn()">enable Slider Control</button>

<script>
function disableBtn() {// w  w w.  j  ava 2 s .c  o m
  document.getElementById("myRange").disabled = true;
}

function enableBtn() {
  document.getElementById("myRange").disabled = false;
}
</script>

</body>
</html>



PreviousNext

Related