Page 311 - Web Applications (803) Class 12
P. 311
const hours = now.getHours().toString().padStart(2, ‘0’);
const minutes = now.getMinutes().toString().padStart(2, ‘0’);
const seconds = now.getSeconds().toString().padStart(2, ‘0’);
timeElement.textContent = `${hours}:${minutes}:${seconds}`;
// ` is the key below Esc key
}
setInterval(updateTime, 1000); // Update time every second
// Initial call to display time
updateTime();
PROJECT 7
Simple website using HTML, CSS and JavaScript to find the corresponding day after taking date, month and year as input.
File1: Index.html
<html>
<head>
<title>Day Finder</title>
<link rel=”stylesheet” href=”styles.css”>
</head>
<body>
<header>
<h1>Day Finder</h1>
</header>
<main>
<div class=”input-container”>
<label for=”input-date”>Date:</label>
<input type=”number” id=”input-date” min=”1” max=”31” required>
<label for=”input-month”>Month:</label>
<input type=”number” id=”input-month” min=”1” max=”12” required>
<label for=”input-year”>Year:</label>
Projects 309

