-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
70 lines (60 loc) · 1.75 KB
/
test.html
File metadata and controls
70 lines (60 loc) · 1.75 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title>Test JavaScript</title>
</head>
<body>
<!-- Inline JavaScript -->
<script type="text/javascript">
document.write("Test JavaScript");
</script>
<script type="text/javascript" src="extern.js">
</script>
<script type="text/javascript">
function meinJavaScript() {
document.write("<p>Schau mal!</p>");
}
</script>
<button type="button" onclick="meinJavaScript()">
Schau mal!
</button>
<button type="button" onmouseover="document.write('gut gemacht')">
Schau mal!
</button>
<br>
<script type="text/javascript">
var nurDeklariert;
document.write("nurDeklariert: " + nurDeklariert + "<br>");
nurDeklariert = "initialisiert"
document.write(nurDeklariert + "<br>");
//Zahlen
var zahl1 = 42;
var zahl2 = 2.5;
var zahl3 = zahl1 - zahl2;
document.write(zahl1 + "<br>");
document.write(zahl2 + "<br>");
document.write(zahl3 + "<br>");
var geteiltDurchZeit = 40/"zwei";
if (isNaN(geteiltDurchZeit)) {
document.write("ungültige Nummer <br>");
} else {
document.write("geteiltDurchZeit: " + geteiltDurchZeit + "<br>")
}
var array =[1, 4, 3, true];
document.write("element: " + array[2] + "<br>");
</script>
<script type="text/javascript">
//eindimensionale array
var a = [1, 5, 6, 2, 9];
document.write("a[2] = "+ a[2] + "<br>")
document.write("a[3] = "+ a[3] + "<br>")
//assoziative arrays
var z = {preis: 1.95, name: "test", quantity: 27 };
document.write("z[preis] = " + z["preis"] + "<br>")
//multidimensionales arrays
var y = [ [5, 6, 7], [8, 9, 10] ]
document.write("y[0][2]= " + y[0][2] +"<br>" )
</script>
<p>© by Lowin</p>
</body>
</html>