-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex2.html
More file actions
53 lines (49 loc) · 1.35 KB
/
index2.html
File metadata and controls
53 lines (49 loc) · 1.35 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Javascript-Test </title>
<style>
table, td {
border:2px solid blue;
padding:1em;
border-collapse: collapse ;
}
h1 {
border:2px dashed black;
border-radius:10px;
width:350px;
text-align:center;
background-color:linen;
padding:1em;
}
h1:hover {
box-shadow:2px 2px 5px grey;
}
</style>
<script>
function rechnung1()
{
var a = 7;
var b = 5;
var element = document.getElementById( "result" );
element.innerHTML = "7 + 5 = "+(a+b); // Klick-Funktion 1
}
function rechnung2()
{
var a = 7;
var b = 5;
var element = document.getElementById( "result" );
element.innerHTML = "7 - 5 = "+(a-b); // Klick-Funktion 1
}
</script>
</head>
<body>
<h1 id="rechnung1" onClick="rechnung1()">Rechnung 1 </h1>
<h1 id="rechnung2" onClick="rechnung2()">Rechnung 2</h1>
<p id="result">
Hier soll das Ergebnis hin!
</p>
</body>
</html>