Practical 1
<html>
<head>
<title>javascript pgm1</title></head>
<body> <center><form>
<h1> Changes the Background Color onMouseOver and also displays the status </h1>
<input type=button value="Colors" onMouseOver='window. setTimeout ("f1()",1200)'>
<input type=button value=" Status " onClick='window. status=("Welcome I.T.Strudents")'>
</form>
<script language="javascript">
function f1()
document.bgColor="Orange";
window.setTimeout("f2()",1200);
function f2()
document.bgColor="blue";
window.setTimeout("f3()",1200);
function f3()
document.bgColor="Green";
window.setTimeout("f4()",1200);
function f4()
document.bgColor="Purple";
window.setTimeout("f5()",1200);
function f5()
{
document.bgColor="Cyan";
window.setTimeout("f6()",1200);
function f6()
document.bgColor="Brown";
window.setTimeout("f7()",1200);
function f7()
document.bgColor="Red";
window.setTimeout("f1()",1200);
</script>
</body>
</html>
Practical 2
<html>
<head>
<title>javascript</title>
</head>
<body onLoad='window.setTimeout("f1()",1200)' onUnload='alert("The page is unloaded")'>
<center>
<h1> Changes the Background Color Automatically and on Unload displays the appropriate message
</h1>
<script language="javascript">
function f1()
document.bgColor="Orange";
window.setTimeout("f2()",1200);
function f2()
document.bgColor="blue";
window.setTimeout("f3()",1200);
function f3()
document.bgColor="Green";
window.setTimeout("f4()",1200);
function f4()
document.bgColor="Purple";
window.setTimeout("f5()",1200);
function f5()
document.bgColor="Cyan";
window.setTimeout("f6()",1200);
function f6()
document.bgColor="Brown";
window.setTimeout("f7()",1200);
function f7()
{
document.bgColor="Red";
window.setTimeout("f1()",1200);
</script>
</body>
</html>