css1
css1
<!DOCTYPE html>
<html>
<head>
<title> Raundal Yash Suresh Roll no:08 </title>
</head>
<body>
<form name="myform">
roll number :<input type="text" name="roll" />
</br></br>
name<input type="text" name="name" />
</br></br>
<img src="12.webp"
onclick="javascript:doocument.form.myform.submit()" />
</br></br>
</form>
</body>
</html>
*************************************************************************************
10. Develop a webpage for creating session and persistent
cookies Observe the effects with browser cookie settings.
<!DOCTYPE html>
<html>
<head>
<title>Raundal Yash Suresh Roll no:08</title>
</head>
<body>
<h1>Cookie</h1>
<h2>Cookies:</h2>
<pre id="cookiesOutput"></pre>
<script>
function setSessionCookie() {
document.cookie = "sessionCookie=Session; path=/";
alert("Session cookie set!");
}
function setPersistentCookie() {
const expires = new Date(Date.now() +3600000).toUTCString();
// 1 hour from now
document.cookie = `persistentCookie=Persistent;
expires=${expires}; path=/`;
alert("Persistent cookie set!");
}
function deleteCookies() {
document.cookie = "sessionCookie=; expires=Thu, 01 Jan 1970
00:00:00 UTC; path=/;";
document.cookie = "persistentCookie=; expires=Thu, 01 Jan
1970 00:00:00 UTC; path=/;";
alert("All cookies deleted!");
checkCookies();
}
function checkCookies() {
document.getElementById("cookiesOutput").textContent =
document.cookie || "No cookies found";
}
</script>
</body>
</html>
**********************************************************
11. Develop a webpage for placing the window on the screen
and working with child window.
<!DOCTYPE>
<html >
<head>
<title>Raundal Yash Suresh Roll no:08</title>
</head>
<body>
<h1>Open Child Window</h1>
<button id="openWindow">Open Child Window</button>
<script>
document.getElementById('openWindow').addEventListener('click'
, () => {
const x = 100; // X position
const y = 100; // Y position
**********************************************************
12. Develop a web page for validation of form fields using
regular expressions.
<!DOCTYPE html>
<html>
<head>
<title>Raundal Yash Roll No:08</title>
<script type="text/javascript">
function TestString(str) {
re = /[az]/
if (re.test(str)) {
alert("The letter a or z or both are present in the string");
}
else {
alert("string done not contain a or z or both");
}
}
</script>
</head>
<body>
<h2>Example of Regular Expression</h2>
<script type="text/javascript">
var input_str = prompt("Enter Some string here")
TestString(input_str);
</script>
</body>
</html>
*************************************************************************************