Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <button onclick="ggez()">
- Click me
- </button>
- <p id="updt">
- Woww click the button.
- </p>
- <script>
- function ggez() {
- const currentDate = new Date();
- const dayIndex = currentDate.getDay();
- const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
- document.getElementById('updt').innerText = `Woww the date is ${days[dayIndex]}`;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement