<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>问候语</title>
<script language="javascript">
function data(){
	var now=new Date();
    var hour=now.getHours();
	if((hour>5)&&(hour<=7))
		alert("早上好!");
	
		 else if((hour>7)&&(hour<=11))
			alert("上午好!");
			 else if((hour>11)&&(hour<=13))
				alert("中午好!");
				 else if((hour>13)&&(hour<=17))
					alert("下午好!");
					 else if((hour>17)&&(hour<=21))
						alert("晚上好");
						 else 
						 
							alert("夜深了,该休息了!");
		 }
		 data()					
							

	 </script>
     
</head>

<body>

     
</body>
</html>