1.用 js实现分时问候

    科技2022-08-26  90

    分时问候,根据上午、下午和晚上,不同时间段打开页面,显示不同的问候内容,0-12点为上午,12-18点为下午,18点以后为晚上

    <script> var now=new Date() var hours=now.getHours() if(hours<12){ document.body.style.backgroundImage='url()' document.write('good-morning') }else if(hours>=12 && hours<18){ document.body.style.backgroundImage='url()' document.write('good-afternoon') }else{ document.body.style.backgroundImage='url()' document.write('go to sleep') } </script>
    Processed: 0.016, SQL: 9