css ex_pr
css ex_pr
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>iframe tag use</title>
</head>
<body>
<div id="menu">
<ul>
<a href="fruits.html" target="frame3">Fruits</a>
<a href="flower.html" target="frame3">Flower</a>
<a href="cities.html" target="frame3">Cities</a>
</ul>
</div>
<iframe id="frame3" name="frame3" src="" frameborder="2" height="100%" width="100%">This is
a frame</iframe>
<script>
document.querySelectorAll('#menu a').forEach(link =>{
document.getElementById("frame3").innerHTML=this.href;
});
</script>
</body>
</html>
2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>replacing a word</title>
</head>
<body>
<script>
var ReplacedString=str1.replace('Fail','Pass');
document.write("<br>")
document.write("Updated String:"+ReplacedString);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cookie</title>
</head>
<body>
<!-- //Explain how to read and write cookie value by implementing an example. -->
<script>
function setCookie() {
function getCookie(name) {
if (cookie.startsWith(name + '=')) {
return "";
function display(){
if (cookieValue) {
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Validation</title>
</head>
<body>
<form action="">
<label>Enter Name:
Enter Email:
</label>
</form>
<script>
function Validation(){
var nameInput=document.getElementById("name");
var mailInput=document.getElementById("Email");
var validationResult=document.getElementById("vdresult");
var mailpattern=/^[a-zA-Z0-9._-]+@[a-zA-z0-9.-]+\.[a-zA-Z]{2,4}$/;
else if(!Email.match(mailpattern)){
else{
}
</script>
</body>
</html>
<!-- Write a JavaScript function to create Fibonacci series till user defines it. -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fibbonessi</title>
</head>
<body>
<script>
function startFibbo() {
return;
let nextfib = 1;
fibSeries.push(nextfib);
nextfib = fibSeries[fibSeries.length - 1] + fibSeries[fibSeries.length - 2];
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>RadioSelection</title>
</head>
<body>
<script>
function updateOption() {
select.innerHTML = "";
options.forEach(option => {
opt.value = option;
opt.textContent=option;
select.appendChild(opt);
});
</script>
<script>
updateOption();
</script>
<label for="">
Fruits
</label>
<label for="">
Vegetables
</label>
<br>
<br>
<select id="options">
</body>
</html>
;;;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>
function updateOptions() {
options.forEach(option => {
});
</script>
</head>
<body>
<label>
Fruits
</label>
<label>
Vegetables
</label>
<br><br>
<select id="options">
<!-- Options will be populated here -->
</select>
<script>
updateOptions();
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<p>
</p>
</form>
<script>
function Education(){
with (document.forms.selection)
if (HS.checked== true) {
selection+="High School";
if(AD.checked == true){
if(BD.checked ==true){
document.write("Your Selection"+selection);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration</title>
</head>
<body>
<form action="">
<label for="name">
<br>
<br>
Gender:
</label>
</form>
<script>
function Register() {
if (radio.checked) {
selectedGender = radio.value;
break;
}
else {
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<!-- Status bar is disabled in modern browsers we need to set a proper css to see effects but this is
not like our intention -->
<body>
function ScrollMessage() {
document.getElementById("scrollingMsg").textContent = scrollingText;
// Update position
pos++;
setTimeout(ScrollMessage,100);
window.onload = ScrollMessage;
</script>
</body>
</html>
10
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Click n Open</title>
</head>
<option value="https://www.google.com">Msbte</option>
<option value="https://www.google.com">Google</option>
</select>
<script>
function show(select){
window.location.href=select.value;
</script>
</body>
</html>
11
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Email Concealing</title>
</head>
<body>
<label for="email">
<p id="result"></p>
<button onclick="ConcealEmail()">Conceal</button>
<script>
function ConcealEmail()
const email=document.getElementById("email").value;
const atIndex=email.indexOf('@');
const sliced=email.slice(atIndex)
document.getElementById("result").innerText="Concealedmail:"+consealing;
else
</script>
</body>
</html>
12
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
#hovertext {
margin-bottom: 20px;
font-size: 18px;
font-weight: bold;
</style>
</head>
<body>
<div id="hovertext"
</div>
<div
onmouseover="changeImage('hover.jpg')"
onmouseout="changeImage('default.jpg')">
</div>
<script>
function changeText(newText) {
document.getElementById("hovertext").innerHTML = newText;
function changeImage(newImage) {
document.getElementById("img").src = newImage;
</script>
</body>
</html>
13
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body onload="ShowBanners()">
</body>
<script>
banner = 0
function ShowLinks() {
document.location.href = MyBannerLinks[banner]
function ShowBanners() {
if (document.images) {
banner++
if (banner == MyBanners.length) {
banner = 0
}
document.ChangeBanner.src = MyBanners[banner]
setTimeout("ShowBanners()", 3000)
</script>
</html>
13.1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Banner Advertisement</title>
</head>
<body onload="showBanners()">
</a>
<script>
const MyBannerLinks = [
'https://www.amazon.in/Advanced-Java-Programming-Ramaraj/dp/9388005392',
'https://www.amazon.in/CSS-Basic-Fundamental-Guide-Beginners-ebook/dp/B07DX74TZ2'
];
let banner = 0;
function showLinks() {
document.location.href = MyBannerLinks[banner];
function showBanners() {
if (document.images) {
banner++;
banner = 0;
document.ChangeBanner.src = MyBanner[banner];
setTimeout(showBanners, 5000);
</script>
</body>
</html>
14
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Slide Show</title>
<script>
let img = 0;
function DisplayingImg(num) {
img = img + num;
img = 0;
if (img < 0) {
img = img_array.length - 1;
window.onload = function() {
};
</script>
</head>
<body>
</body>
</html>
15
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p id="result"></p>
<script>
function NextPage(){
window.history.forward();
function previousPage(){
window.history.back();
function go()
window.history.go1(2);
// let host=window.location.host;
// let protocol=window.location.protocol;
// let port=window.location.port;
// let href=window.location.href;
// let Origin=window.location.origin;
// let pathname=window.location.pathname;
result.push(window.location[array[i]]);
document.getElementById("result").innerText = outputString;
</script>
</body>
</html>
16
<html>
<head>
</head>
<body>
<script>
var mycar={
get nameCar(){
return this.carName;
},
set nameCar(newName){
return this.carName=newName;
},
};
mycar.nameCar = "Bugatti";
</script>
</body>
</html>
17
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Flowers array</title>
</head>
<body>
<p id="flr"></p>
<script>
flower.forEach(element => {
document.write(element+", ");
});
</script>
</body>
18
<html>
<script>
function calAvg(){
var sub1 = 56;
document.write("A Grade");
document.write("B Grade");
document.write("C Grade");
else{
document.write("F Grade");
</script>
<body>
</body>
</html>