0
Date methods of date object in JS
function printTime() { var d = new Date(); var hours = d.getHours(); var mins = d.getMinutes(); var secs = d.getSeconds(); document.body.innerHTML = hours+":"+mins+":"+secs; } setInterval(printTime, 1000); How can I print the current time once every second to my laptop screen. Please care to expand. Thanks in advance.
1 Antwort
0
Laptop screen? Did you mean browser screen in fact?