Input Time stepDown() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

The stepDown() method decrements the MINUTES of the time field by a specified number.

Parameter Values

Parameter Description
numberRequired. amount of minutes the time field should decrease.

If omitted, the minutes are decremented by "1"

Return Value:

No return value

The following code shows how to Decrement the value of a time field by 1 minute:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Time: <input type="time" id="myTime" value="16:32:55">

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/* ww  w  .  j  ava 2s . co m*/
    document.getElementById("myTime").stepDown();
}
</script>

</body>
</html>

Related Tutorials