Input Month stepUp() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Month


The stepDown() method increments the MONTHS value of the month field by a specified number.

Parameter Values

Parameter Description
numberRequired. amount of months the month field should increase.

If omitted, the months are incremented by "1"

Return Value:

No return value

The following code shows how to Increment the value of a month field by 3 months:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

Month and year: <input type="month" id="myMonth" value="1997-11">

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

function myFunction() {//  ww w .j av a  m


Related Tutorials