We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
截止时间 2020年11月11日 0点
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>倒计时</title> </head> <body> <section> <p>倒计时</p> <span class="daySpan"></span> <span class="hourSpan"></span> <span class="minuSpan"></span> <span class="secondSpan"></span> </section> <script> let daySpan = document.querySelector('.daySpan') let hourSpan = document.querySelector('.hourSpan') let minuSpan = document.querySelector('.minuSpan') let secondSpan = document.querySelector('.secondSpan') let deadLine = new Date('2020-11-11 00:00') let countDown = () =>{ let timeout = deadLine - new Date() if(timeout < 0) return 0 let day = Math.floor(timeout/1000/60/60/24) let hour = Math.floor(timeout/1000/60/60%24) let minu = Math.floor(timeout/1000/60%60) let second = Math.floor(timeout/1000%60) daySpan.innerHTML = day + '天' hourSpan.innerHTML = hour + '时' minuSpan.innerHTML = minu + '分' secondSpan.innerHTML = second + '秒' setTimeout(countDown,1000) } countDown() </script> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
截止时间 2020年11月11日 0点
The text was updated successfully, but these errors were encountered: