<html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Today's Date</title> </head> <body> </body> </html>
If you save the above HTML file, and load it into the browser of your choice, you should see a blank page with the title of the page as
Today's Date .
let d = new Date(); document.body.innerHTML = "<h1>Today's date is " + d + "</h1>"
You’ll receive the following output on the Console:
Output"<h1>Today's date is Sat Jun 24 2017 12:16:14 GMT-0400 (EDT)</h1>"
And at this point, your page should look similar to this: