Correction status:Uncorrected
Teacher's comments:
<!DOCTYPE html> <html dir="ltr"> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> #box{ width: 500px; height: 100px; margin: 200px auto; background: #3AD900; text-align: center; line-height: 100px; } #sp{ width: 212.44px; height: 21px; } </style> </head> <script type="text/javascript" src="jquery-3.3.1.js"></script> <body> <div id="box">清明倒计时: <span>2天14小时37分钟35秒000毫秒</span> </div> <script> $(function(){ function time(){ var d=Date.parse('Apr 05,2019'); 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); var hm=Math.floor((d-dd)%1000); if(hm<100){ if(hm<10){ hm="00"+hm; }else{ hm="0"+hm; } } $('span').text(days+'天'+hours+'小时'+minus+'分钟'+secos+'秒'+hm+"毫秒"); } setInterval(time,1) }) </script> </body> </html