JavaScript setMonth()

The JavaScript date setMonth() method sets the month value for the particular date on the basis of local time.

Syntax:

dateObj.setMonth(new_Month);

Parameters:
new_Month: Integer value between 0 to 11.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var bday =new Date("November 16, 1994 21:00:10");
document.writeln(bday.getMonth() + "<br>");
bday.setMonth(11);
document.writeln(bday.getMonth());
</script>
</body>
</html>