Java Script Note 2025 - Using Date Objects 4.9
<html>
<head>
<title>using data objects</title>
<script language="JavaScript">
var d,s;
function fun()
{
d=new Date();
h=d.getHours();
m=d.getMinutes();
s=d.getSeconds();
time=h+":"+m+":"+s;
document.form1.text1.value=time;
if(s%2==0)
{
document.bgColor="lightYellow";
}
else
{
document.bgColor="lightGreen";
}
}
setInterval("fun()",3000);
</script>
</head>
<body>
<h1> welcome </h1>
<form name="form1">
the time is:
<input type=text name=text1 size="10">
</form>
</body>
</html>
0 Comments