Prev Demo
Displaying The Present Time On The Window In Javascript.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Below is the the current run time.</p> <p id="myId"></p> <script> var myTime = setInterval(function () { myRuntime() }, 1000); function myRuntime() { var a = new Date(); var b = a.toLocaleTimeString(); document.getElementById("myId").innerHTML = b; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output