W PDF
W PDF
(102)
PROJECT FILE
BATCH:- 2023-2026
Submitted To- MR.FARHAN RAZA RIZVI SIR Submitted By- AJAY YADAV
Assistant Professor,Dept. CSA BCAN1CA23005
1.Create a specimen of corporate web page. Divide the browser screen into two frames.
The frame on the left will be a menu consisting of hyperlinks. Clicking on any of these
links will lead to a new page, which must open in a target frame on the right side.
Solution:
Index.html
Menu.html
Page 1.html
Page 2.html
Content_Holder.html
Output (Index)
Output (Page 1)
Output (Page 2)
2. Write a java script code block, which validates a user name and password
against hard coded values. If either name or password field is not entered display
an error message showing “You forgot one of the required fields. Please try
again” In case the field matched do not match the hard coded values, display an
error message showing : “Please enter a valid user name and password” If the
field entered matched , Display the following message: “Welcome (Username)”.
Sol.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Validation</title>
<style>
.error {
color: red;
}
</style>
</head>
<body>
<h2>Login Form</h2>
<script>
function validateLogin() {
// Reset error message
document.getElementById('error').innerText = '';
Sol.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Handling Example</title>
<style>
#myDiv {
width: 200px;
height: 100px;
background-color: lightblue;
text-align: center;
line-height: 100px;
cursor: pointer;
}
</style>
</head>
<body>
// OnMouseOver event
function handleMouseOver() {
document.getElementById("myDiv").style.backgroundColor = "lightgreen";
}
// OnMouseOut event
function handleMouseOut() {
document.getElementById("myDiv").style.backgroundColor = "lightblue";
}
// Onload event
window.onload = function () {
console.log("Page has been loaded!");
};
// Onchange event
function handleChange() {
var inputText = document.getElementById("myInput").value;
console.log("Input changed to: " + inputText);
}
</body>
</html>