-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path028 intervalgerisay.html
57 lines (47 loc) · 1.39 KB
/
028 intervalgerisay.html
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
56
57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
#zaman{
background-color: navy;
color:white;
float:right;
width: 200px;
height: 40px;
font-size:30px;
text-align: center;
}
</style>
</head>
<body>
<div id="zaman"></div>
<script>
dakika=1;
saniye=0;
if(dakika<10) dakikaStr="0"+dakika;
if(saniye<10) saniyeStr="0"+saniye;
document.getElementById("zaman").innerHTML=dakikaStr+":"+saniyeStr;
setInterval(() => {
if(dakika<10){
dakikaStr="0"+dakika;
} else dakikaStr=dakika;
if(saniye<10){
saniyeStr="0"+saniye;
} else saniyeStr=saniye;
if(dakika==0 && saniye==0){
alert("Süre Bitti");
exit();
}
document.getElementById("zaman").innerHTML=dakikaStr+":"+saniyeStr;
if(saniye==0)
{
dakika--;
saniye=59;
} else saniye--;
}, 1000); // 1000 milisaniye = 1 saniye
</script>
</body>
</html>