Input Time stepUp() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

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

Parameter Values

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

If omitted, the minutes are incremented by "1"

Return Value:

No return value

The following code shows how to Increment the value of a time field by 10 minutes:

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() {/*from  w w w.  ja  va 2s  .  c o m*/
    document.getElementById("myTime").stepUp(10);
}
</script>

</body>
</html>

Related Tutorials