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 posgresql backup/restore mysql ...
Table of contents Configuration parsing Service C...
1. Check whether event is enabled show variables ...
Install memcached yum install -y memcached #Start...
Table of contents 1. Function Introduction 2. Key...
This article example shares the specific code of ...
HTML operation principle: 1. Local operation: ope...
1. Command Introduction The ifconfig (configure a...
Jenkins is an open source software project. It is...
Effect html <div class="sp-container"...
Table of contents Preface 1. What are Mixins? 2. ...
As a required course for front-end developers, CS...
Background Threads •Master Thread The core backgr...
First, let’s take a look at a CSS carousel animat...
This article example shares the specific code for...