-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjam-digital.html
More file actions
55 lines (51 loc) · 1.2 KB
/
jam-digital.html
File metadata and controls
55 lines (51 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<title>Tutorial Membuat Jam Analog dan Digital dengan Javascript</title>
</head>
<body>
<style>
h1,h2,h3,h4,p,a{
font-family: sans-serif;
font-weight: normal;
}
.jam-digital {
overflow: hidden;
width: 330px;
margin: 20px auto;
border: 5px solid #f28000;
}
.kotak{
float: left;
width: 110px;
height: 100px;
background-color: #c1c1c1;
}
.jam-digital p {
color: #fff;
font-size: 36px;
text-align: center;
margin-top: 30px;
}
</style>
<center>
<h3>Tutorial Membuat Jam Analog dan Digital dengan Javascript</h3>
<h4>Jam Digital dengan Javascript</h4>
</center>
<div class="jam-digital">
<div class="kotak"><p id="jam"></p></div>
<div class="kotak"><p id="menit"></p></div>
<div class="kotak"><p id="detik"></p></div>
</div>
<center><p>RAJA PUTRA MEDIA</p></center>
<script>
window.setTimeout("waktu()", 1000);
function waktu() {
var waktu = new Date();
setTimeout("waktu()", 1000);
document.getElementById("jam").innerHTML = waktu.getHours();
document.getElementById("menit").innerHTML = waktu.getMinutes();
document.getElementById("detik").innerHTML = waktu.getSeconds();
}
</script>
</body>
</html>