-
Notifications
You must be signed in to change notification settings - Fork 0
/
piechard.html
53 lines (46 loc) · 1.41 KB
/
piechard.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
<!DOCTYPE html>
<html>
<head>
<title>Pytanie nr 5</title>
<link rel="stylesheet" type="text/css" href="stajl.css">
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>Pytanie 5</h1>
<div id="some_div"></div>
<div style="clear: both;"></div>
</div>
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>W pudełku jest 12 piłeczek - 3 niebieskie, 4 zielone, 5 czerwonych. Jakie jest prawdopodobieństwo wylosowania zielonej piłki?</p><br /><br /><br /><br />
<div class="buttons">
<button><a href="szeschard.html">A. <b>1/3</b></a></button>
<button><a href="zlahard.html">B. <b>1/4</b></a></button>
<button><a href="zlahard.html">C. <b>1</b></a></button>
<button><a href="zlahard.html">D. <b>7/12</b></a></button>
</div>
<script>
var timeLeft = 50;
var elem = document.getElementById('some_div');
var timerId = setInterval(countdown, 1000);
function countdown() {
if (timeLeft == -1) {
clearTimeout(timerId);
doSomething();
} else {
elem.innerHTML = timeLeft;
timeLeft--;
}
if (timeLeft == 19){
elem.style.color = 'orange';
}
if (timeLeft == 9){
elem.style.color = 'red';
}
}
function doSomething() {
window.location.href = "zlahard.html"
}
</script>
</body>
</html>