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
Table of contents Union query 1. Query the ID and...
1. Install tools and libraries # PCRE is a Perl l...
Table of contents 1 Version and planning 1.1 Vers...
MySQL service 8.0.14 installation (general), for ...
Often when we open foreign websites, garbled char...
This article mainly involves solutions to problem...
When using Nginx as a Web server, I encountered t...
This article shares the specific code of JS to ac...
Gird layout has some similarities with Flex layou...
Table of contents question 1. Install webpack web...
Introduction <br />Not everyone has access t...
This article compares and summarizes four ways of...
Table of contents 1. Preprocessing 2. Compilation...
Effect: CSS style: <style type="text/css&...
1. Packetdrill compilation and installation Sourc...