Input DatetimeLocal stepDown() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Datetime Local

Description

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

Parameter Values

Parameter Description
numberRequired. the amount of minutes the datetime 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 datetime field by 10 minutes:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Date: <input type="datetime-local" id="myLocalDate" value="2014-11-16T15:00:33">

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

<script>
function myFunction() {/*from  w ww . ja v a2s. c o m*/
    document.getElementById("myLocalDate").stepDown(10);
}
</script>

</body>
</html>

Related Tutorials