China Naming Network - Ziwei Dou Shu - How does js get the points in years, months, days, minutes and seconds?
How does js get the points in years, months, days, minutes and seconds?
The materials to be prepared are: computer, html editor and browser.
1. First, open an html editor and create a new html file, such as index.html.
2. In index.html
var a = new Date(); document.body.innerHTML?
= ' when:'+a . get hours()+' < br/& gt; points:'+a . get minutes()+' < br/& gt; Seconds: "+a.getseconds ();
3. The browser runs the index.html page. At this point, js gets and prints every minute of the current time.