1 Star 0 Fork 0

webrx / js02

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jsif.html 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
webrx 提交于 2017-01-14 19:59 . Initial commit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js0201</title>
</head>
<body>
<script>
var d = new Date(); //此处使用了js内置对象 Date (日期对象)
var h = d.getHours();
//if(h>=18) document.write("晚上好");
//if(h>=23) document.write("夜深了,注意身体.");
if(h>=8 && h<11){
document.write("上午好");
}else if(h>=12 && h<13){
document.write("中午好");
}else if(h>=14 && h<17){
document.write("下午好");
//document.bgColor = 'blue';
document.body.style.background = '#ff0';
//相当于 <style> body{background:#ff0;}</style>
}else if(h>=18){
document.write("晚上好");
document.bgColor = 'red';
}
//if() ;
//if(){}
//if(){}else{}
//if(){}else if(){}else if(){}else{}
</script>
</body>
</html>
1
https://gitee.com/webrx/js02.git
git@gitee.com:webrx/js02.git
webrx
js02
js02
master

搜索帮助