Use HTML to write a dynamic web clock. The code is as follows: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Clock Effects</title> </head> <script type="text/javascript"> function disptime(){ var today = new Date(); var hh=today.getHours(); var mm=today.getMinutes(); var ss = today.getSeconds(); document.getElementById("myclock").innerHTML="<h1>Now is—"+hh+":"+mm+":"+ss+"</h1>" } //The setInterval() method can call a function or calculate an expression according to the specified period var mytime = setInterval("disptime()",1000); </script> <body onload="disptime()"> <div id="myclock"></div> </body> </html> Summarize The above is what I introduced to you about writing a dynamic clock on a web page in HTML. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: JavaScript article will show you how to play with web forms
>>: mysql method to recursively search for all child nodes of a menu node
Preface: In the daily use of the database, it is ...
Server placement It is recommended to use cloud s...
Table of contents Immediately execute function fo...
One day I found that the execution speed of a SQL...
Today I'd like to introduce a countdown made ...
background When we want to log in to the MySQL da...
1. Basic steps 1: Install yarn add vue-i18n Creat...
Preface: Use the element framework in vue3.0, bec...
I was bored and sorted out some simple exercises ...
1. Tools directory file structure [root@www tools...
Preface The method of configuring IP addresses in...
This article describes the mysql show operation w...
Preface In Windows, you can start multiple MySQL ...
Docker is being used in more and more scenarios. ...
In the Docker system learning tutorial, we learne...