Advertisement
brandblox

WebLab-2-(24/9/24)

Sep 24th, 2024
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.66 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Document</title>
  7. </head>
  8. <body>
  9.     <button onclick="ggez()">
  10.         Click me
  11.     </button>
  12.     <p id="updt">
  13.         Woww click the button.
  14.     </p>
  15.     <script>
  16.         function ggez() {
  17.             const currentDate = new Date();
  18.             const dayIndex = currentDate.getDay();
  19.             const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  20.             document.getElementById('updt').innerText = `Woww the date is ${days[dayIndex]}`;
  21.         }
  22.     </script>
  23. </body>
  24. </html>
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement