Displaying Source Code(s)
|
|
Change background color after 5 seconds.
--------------------------------------------------------------------------------
Description : Change background color after 5 seconds.
<html>
<head>
<script language=javascript>
var count=0;
function as()
{
setTimeout("fun1()",5000);
}
function fun1()
{
var a =new
Array("red","darkblue","sky","yellow","blue","pink","green");
if(count<=6)
{
document.bgColor=a[count++];
setTimeout("fun1()",5000);
}
else
{
count=0;
as();
}
}
</script>
</head>
<body bgcolor=gray onload=as()>
</body>
</html>
-------------------------------------------------------------------------------- |
|
|