Joke Collection Website - Public benefit messages - How to write an html webpage to realize that there are ** days until the end of the month, ** days before the middle of the year, and ** days before the end of the year, and require automatic calculat
How to write an html webpage to realize that there are ** days until the end of the month, ** days before the middle of the year, and ** days before the end of the year, and require automatic calculat
Simple js countdown
lt;!DOCTYPE HTMLgt;
lt;htmlgt;
lt;headgt;
meta http-equiv="Content-Type" content="text/html; charset=utf-8"gt;
lt;titlegt;Untitled documentlt;/titlegt;
lt; stylegt;
#s1 { font-size: 60px; font-weight: bold; }
lt;/stylegt;
lt;/headgt;
lt;bodygt;
lt;span id="s1"gt;lt;/spangt;
lt;/ bodygt;
lt;/htmlgt;
lt;scriptgt;
window.onload=function(){
var oSpan = document.getElementById('s1');
var nDate = new Date('sep 8, 2014'); //Modify the countdown time
showTime();
p>setInterval(showTime, 1000);
function showTime(){
var oDate = new Date(); //Get the time of the local display
var time = Math.floor( (nDate - oDate) / 1000 );
var d = Math.floor( time / 86400 );
var h = Math. floor( time 86400 / 3600 );
var m = Math.floor( time 86400 3600 / 60 );
var s = time 60;
oSpan .innerHTML = "There are still days before the Mid-Autumn Festival in 2014: lt; br /gt;"
d 'day' h 'hour' m 'minute' s 'second';
}
};
lt;/scriptgt;
- Previous article:How does SMS become a QQ yellow diamond? urgent
- Next article:How to set the skin of Meizu SMS chat interface?
- Related articles
- Does Zhixing train ticket software charge during use?
- What if I forget my tobacco password?
- What does phone mean?
- What if the mobile phone receives a text message but the notification bar doesn't display it?
- How to comfort the helplessness of not getting together in the New Year?
- Why is the verification code sent by Aauto faster only used for authentication?
- 12306 sent 999 and didn't reply. What is the reason?
- Service provider that sends verification code short messages to users?
- How to bless them when playing mahjong?
- How to make up for the unsuccessful etc deduction?