<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><meta http-equiv="content-type" content="text/html;charset=utf-8"/><html><body><p>点击这个按钮,获得基于时间的问候。</p><button onclick="myFunction()">点击这里</button><script>function myFunction(){var x="";var time=new Date().getDay();if (time=0) { x="Good morning"; }else if (time=1) { x="Good day"; }else { x="Good evening"; }alert(x);}</script></body></html>
添加回答
举报
0/150
提交
取消