How to View a Digital Clock in HTML

Table of contents:

How to View a Digital Clock in HTML
How to View a Digital Clock in HTML
Anonim

Using the HTML language natively, it is not possible to display the time in digital format and have it automatically update like a real clock. To do this, you need to use a JavaScript that must be inserted into the HTML code of the page. This article shows you exactly how.

Steps

Italicize Text in HTML Step 1
Italicize Text in HTML Step 1

Step 1. Open a simple text editor like Notepad or Notepad ++ on Windows systems or TextEdit on Mac

Step 2. Create an HTML document using the following code

     
Display Time in HTML Step 3
Display Time in HTML Step 3

Step 3. Save the newly created document

Use a custom name to make it easy to locate and use via your internet browser. Remember to change the file extension to ".html" (without quotes).

Step 4. Open the HTML file you just generated

Inside the web page shown by the internet browser there should be a clock in digital format, which shows the current time and updates in real time.

Recommended: