today tomorrow day after tomorrow button html and javascript

Solutions on MaxInterview for today tomorrow day after tomorrow button html and javascript by the best coders in the world

showing results for - "today tomorrow day after tomorrow button html and javascript"
Julia
24 Sep 2016
1const tomorrow = new Date()
2// add 1 day to today
3tomorrow.setDate(new Date().getDate() + 1)
4console.log(tomorrow) 
5
6const dayAfterTomorrow = new Date()
7// add 2 day to today
8dayAfterTomorrow.setDate(new Date().getDate() + 2)
9console.log(dayAfterTomorrow) 
10//A date instance in JavaScript provides a .setDate() method to set the day of the month. A goody provided by this method: it automatically switches the month in case you’re exceeding the days in a month.
11//At first, you need “today” as a reference. Use the new Date() constructor to create a date instance of today. Then, retrieving the day of tomorrow is a calculation of adding one day to the current day of the month using. You can retrieve the day of “today” using the .getDate() method.
12