<script type="text/javascript">
function hello(){
var date = new Date();
var hours = date.getHours();
var msg ="";
if(hours>=6&&hours<=12){
msg="早上好,欢迎来宁波教育学院文教路校区";
}else if(hours>=13&&hours<=18){
msg="下午好,欢迎来宁波教育学院文教路校区";
}else{
msg="晚上好,欢迎来宁波教育学院文教路校区";
}
document.getElementById("hello").innerHTML="<h3>"+msg+"</h3>";
}
</script>
</head>
<body onload="hello()">
<span id="hello"></span>
网友评论