Javascript DOM HTML Input Time stepDown() Method without parameter

Introduction

Decrement the minutes by 1 (default):

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

Click the button to decrement the value of the time field by 1 minute.

This is the same as clicking the down arrow on the right side of the time field for the "minute" section.

View in separate window

<!DOCTYPE html>
<html>
<body>

Time: <input type="time" id="myTime" value="21:43:54">
<button onclick="myFunction()">Test</button>

<script>
function myFunction() {//www. j  ava2  s  .c  o m
  document.getElementById("myTime").stepDown();
}
</script>

</body>
</html>



PreviousNext

Related