-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlecture7.html
29 lines (25 loc) · 872 Bytes
/
lecture7.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
<!doctype html>
<html>
<head>
<title>Using if-Statements</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
</style>
</head>
<body>
<input id="usersWeatherInput" placeholder="Bitte Wetter eingeben"></input>
<button id="submitWeather">Wetter abschicken!</button>
<script type="text/javascript">
// on click the value of usersWeatherInput is evaluated and an alert ist called
document.getElementById('submitWeather').onclick = function alertGivenWeather() {
if (document.getElementById('usersWeatherInput').value == "Regen") {
alert("Momentan regnet es.");
} else {
alert("Momentan regnet es nicht");
}
}
</script>
</body>
</html>