over 9 years ago
To set the day of the month (1-31), we use setDate() method
Example
- <!DOCTYPE html>
- <html>
- <body>
- <h1>Evon technologies</h1>
- <p>The Example of setDate() method to set the date of a month</p>
- <p id="z"></p>
- <script>
- var d = new Date();
- d.setDate(23);
- document.getElementById("z").innerHTML = d;
- </script>
- </body>
- </html>
<!DOCTYPE html> <html> <body> <h1>Evon technologies</h1> <p>The Example of setDate() method to set the date of a month</p> <p id="z"></p> <script> var d = new Date(); d.setDate(23); document.getElementById("z").innerHTML = d; </script> </body> </html>
Can you help out the community by solving one of the following Javascript problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)