Javascript DOM HTML Input Time stepUp() Method without parameter

Introduction

Increment the minutes by 1 (default):

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

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

This is the same as clicking the up 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() {// w w w .  j  av  a  2 s . c  o m
  document.getElementById("myTime").stepUp();
}
</script>

</body>
</html>



PreviousNext

Related