setDate() sets the day of the month to 1-31.

<!DOCTYPE html>
<html>
<body>

<p>The setDate() method sets the date of a month.</p>

<p id="demo"></p>

<script>
var d = new Date();
d.setDate(25);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

OUTPUT :


The setDate() method sets the date of a month.


  • Prakash Singh

    usful… and nice