-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
21 lines (20 loc) · 715 Bytes
/
script.js
File metadata and controls
21 lines (20 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
`use strict`;
const myday = document.querySelector(`.day`);
const mymonth = document.querySelector(`.month`);
const myyear = document.querySelector(`.year`);
const btn = document.querySelector(`.btn1`);
const myweekday = document.querySelector(`.weekday`);
const weekday=new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
btn.addEventListener(`click`, function(){
const date = new Date(`${mymonth.value},${myday.value},${myyear.value}`);
const dayNumber = date.getDay();
myweekday.textContent = `${weekday[dayNumber]}! 😊⌚`;
myday.value = mymonth.value = myyear.value = "";
});