JavaScript Reference/Javascript Methods/setMonth
"setMonth()" Example
<html>
<body>
<button onclick="var myDate = new Date(); myDate.setMonth(5); alert(myDate);">SETMONTH</button>
</body>
</html>
"setMonth()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |Date |
+----------------+--------------------------------------------------------------+
"setMonth()" Syntax, Parameters and Note
Note:
Sets the month.
Syntax:
dateName.setMonth(param1, param2)
Parameters:
param1 Required; the month. Value: 0 to 11.
param2 Optional; the day of the month. Value: 1 to 31.