MEMBUAT JAM DIGITAL SEDERHANA MENGGUNAKAN JAVASCRIPT

kopikan script dibawah ini ke notpade terus save dengan dot(.) html
<html>  
<head>  
<title>Jam Digital</title>  
<script type="text/javascript">  
// 1 detik = 1000  
window.setTimeout("waktu()",1000);    
function waktu() {     
    var tanggal = new Date();    
    setTimeout("waktu()",1000);    
    document.getElementById("output").innerHTML = tanggal.getHours()+":"+tanggal.getMinutes()+":"+tanggal.getSeconds();  
}  
</script>  
</head>  
  
<body bgcolor="white" text="black" onload="waktu()">  
<table align=center style="border:1px solid black" bgcolor="#CCCCCC"><tr><td>  
<div id="output">  
</div></td></tr>  
</table>  
</body>  
</html>  



2 thoughts on “MEMBUAT JAM DIGITAL SEDERHANA MENGGUNAKAN JAVASCRIPT

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s