1、<script>today=newDate();varday;va筠续师诈rdate;varhello;varwel;hour=n髫潋啜缅ewDate().getHours()if(hour<6)hello='凌晨好'elseif(hour<9)hello='早上好'elseif(hour<12)hello='上午好'elseif(hour<14)hello='中午好'elseif(hour<17)hello='下午好'elseif(hour<19)hello='傍晚好'elseif(hour<22)hello='晚上好'else{hello='夜里好'}if(today.getDay()==0)day='星期日'elseif(today.getDay()==1)day='星期一'elseif(today.getDay()==2)day='星期二'elseif(today.getDay()==3)day='星期三'elseif(today.getDay()==4)day='星期四'elseif(today.getDay()==5)day='星期五'elseif(today.getDay()==6)day='星期六'date=(today.getYear())+'年'+(today.getMonth()+1)+'月'+today.getDate()+'日';document.write(hello);</script><script>document.write(date+''+day+'');</script>
2、修改分时问候文本的颜色为白色显示网页中脚本元素步骤:“编辑”菜单栏→首选参数→不可见元素→选择“脚本”,如下图所示:方法一:拖动鼠标选中脚本标记,在属性面板下字体颜色设置为白色方法二:应用<font></font>标记来修改字体颜色。