Just started to learn, very meng, want to ask, thank you!
CodePudding user response:
Work to theCodePudding user response:
& lt; ! DOCTYPE html>
& lt; HTML lang="en" & gt;
& lt; head>
& lt; Meta charset="utf-8" & gt;
& lt; Meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
& lt; title> Document
& lt;/head>
& lt; body>
& lt; Div id="date" & gt; & lt;/div>
& lt;/body>
& lt; script>
Let dateBox=document. GetElementById (" date "),
The date=new date (),
DateStr=date. ToLocaleString (),
Week=date. GetDay (),
WeekStr;
The switch (week) {
Case 0:
WeekStr='Sunday'
break;
Case 1:
WeekStr='Monday'
break;
Case 2:
WeekStr='Tuesday'
break;
Case 3:
WeekStr='on Wednesday,'
break;
Case 4:
WeekStr='Thursday'
break;
Case 5:
WeekStr='Friday'
break;
Case 6:
WeekStr='Saturday'
break;
Default:
break;
}
DateBox. The innerText=` ${dateStr} ${weekStr} `;
DateBox. Onclick=function () {
Alert (' if you are not in the fishing, can see in what stand for class B network video ');
}
& lt;/script>
& lt;/html>