we can create digital clock using javascript using given code
example:-
example:-
<html>
<head>
</head>
<body>
<script language="javascript">
function func()
{
mydate=new Date();
h=mydate.getHours();
m=mydate.getMinutes();
s=mydate.getSeconds();
document.f.h.value=h;
document.f.m.value=m;
document.f.s.value=s;
}
window.setInterval("func()",1000)
</script>
<h3 align="center">Digital Clock By Critical Codes</h3>
<br><br>
<center>
<form name="f"> <font color="green">
hour : <input type="text" name="h" size="2">
minute : <input type="text" name="m" size="2">
sec : <input type="text" name="s" size="2"></font>
</form>
</center>
</body>
</html>
No comments:
Post a Comment