分享

113.【特效】每个时间段的问候语代码

 怡心别苑 2011-07-12

代码:

<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr> <td>
<div align="center"><br>
<script language="javaScript">
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("凌晨好!")}
else if (hour < 9){document.write("早上好!")}
else if (hour < 12){document.write("上午好!")}
else if (hour < 14){document.write("中午好!")}
else if (hour < 17){document.write("下午好!")}
else if (hour < 19){document.write("傍晚好!")}
else if (hour < 22){document.write("晚上好!")}
else {document.write("夜里好!")}
</script>
</div>
</td></tr>
</table>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多