Page 295 - Web Applications (803) Class 12
P. 295
<main>
<p>Welcome to the home page of our website.</p>
</main>
<p id=”datetime”></p>
<script>
function display() {
var datetimeElement = document.getElementById(“datetime”);
var currentDate = new Date();
var str1 = “Current Date and Time: “ + currentDate.toLocaleString();
datetimeElement.textContent = str1;
}
display(); // Function call
// Refresh the date and time every second
setInterval(display, 1000);
</script>
</body>
</html>
File2: About.html
<html>
<head>
<link rel=”stylesheet” href=”styles.css”>
<title>About</title>
</head>
<body>
<header>
<h1>About Page</h1>
<nav>
<ul>
<li><a href=”index.html”>Home</a></li>
<li><a href=”about.html”>About</a></li>
<li><a href=”contact.html”>Contact</a></li>
</ul>
</nav>
</header>
<main>
<p>Learn more about our company on the about page.</p>
</main>
</body>
Projects 293

