Correction status:Uncorrected
Teacher's comments:
<!DOCTYPE html> <html> <head> <title>hello world!</title> <style type="text/css"> *{margin: 0;padding: 0;} div{font-size: 36px;width: 1200px;height: 180px;margin: 100px auto;background: #E43B1F;line-height: 180px;text-align: center;color: #fff} </style> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> </head> <body> <div> <p>2020年春节倒计时:<span></span></p> </div> <script type="text/javascript"> $(function(){ function Ro(){ var d=Date.parse("Jan 25,2020"); var date=new Date(); var dd=date.getTime(); var rd=Math.floor((d-dd)/1000); var days=Math.floor(rd/86400); var hours=Math.floor(rd%86400/3600); var minus=Math.floor(rd%3600/60); var secos=Math.floor(rd%60); $("span").text(days+"天"+hours+"小时"+minus+"分钟"+secos+"秒") } setInterval(Ro,1) }) </script> </body> </html>
点击 "运行实例" 按钮查看在线实例