Showing Real Time Data using HTML
#this shows real time#
#coded by Devansh mishra#
<html>
<head>
<title>Devansh Mishra</title>
<script type="text/javascript">
window.setTimeout("waktu()",1000);
function waktu() {
var tanggal = new Date();
setTimeout("waktu()",1000);
document.getElementById("jam").innerHTML = tanggal.getHours();
document.getElementById("menit").innerHTML = tanggal.getMinutes();
document.getElementById("detik").innerHTML = tanggal.getSeconds();
}
</script>
</head>
<style>
#jam-digital{overflow:hidden; width:350px}
#hours{float:left; width:100px; height:50px; background-color:#6B9AB8; margin-right:25px}
#minute{float:left; width:100px; height:50px; background-color:#A5B1CB}
#second{float:right; width:100px; height:50px; background-color:#FF618A; margin-left:25px}
#jam-digital p{color:#000; font-size:36px; text-align:center; margin-top:4px}
</style>
<body onLoad="waktu()">
<div id="jam-digital">
<div id="hours"><p id="jam"></p></div>
<div id="minute"><p id="menit"></p></div>
<div id="second"><p id="detik"></p></div>
</div>
</table>
</body>
</html>
Comments
Post a Comment