Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views3 pages

SCRIPT Project

The document contains a simple digital clock implementation using HTML, CSS, and JavaScript. The JavaScript function updates the displayed time every second, while the CSS styles the clock's appearance. The HTML structure includes a container for the clock and links to the external CSS and JavaScript files.

Uploaded by

diwanhitesh5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

SCRIPT Project

The document contains a simple digital clock implementation using HTML, CSS, and JavaScript. The JavaScript function updates the displayed time every second, while the CSS styles the clock's appearance. The HTML structure includes a container for the clock and links to the external CSS and JavaScript files.

Uploaded by

diwanhitesh5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SCRIPT :-

// script.js

function updateTime() {

const now = new Date();

const hours = String(now.getHours()).padStart(2, '0');

const minutes = String(now.getMinutes()).padStart(2, '0');

const seconds = String(now.getSeconds()).padStart(2, '0');

const timeString = `${hours}:${minutes}:${seconds}`;

document.getElementById('time').textContent = timeString;

// Update the time every second

setInterval(updateTime, 1000);

// Initialize the clock when the page loads

updateTime();

STYLE :-

/* styles.css */

body {

display: flex;

justify-content: center;

align-items: center;

height: 100vh;

margin: 0;
background-color: #0c0d03e6;

font-family: 'Arial', sans-serif;

.watch {

background-color: #f4a90765;

border-radius: 10px;

padding: 20px;

box-shadow: 0 0 20px rgba(231, 243, 3, 0.884);

text-align: center;

#time {

font-size: 48px;

color: #150202;

font-family: 'Courier New', monospace;

HTML :-

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Digital Watch</title>

<link rel="stylesheet" href="style14.css">

</head>

<body>
<div class="watch">

<div id="time"></div>

</div>

<script src="java14.js"></script>

</body>

</html>

You might also like