-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (59 loc) · 1.66 KB
/
index.html
File metadata and controls
62 lines (59 loc) · 1.66 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
<!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 h1Click()
{
var element = document.getElementById( 'ueberschrift' );
element.innerHTML = "Geklickt"; // Klick-Funktion 1
}
function printTable( rowCount, colCount )
{
document.write( "<table>\r\n" ); //Klick-Funktion 2
//var i = 0;
//for ( initialisierung; bedingung;z.b hochzählen (i++) )
for( var r = 0;r < rowCount; r++ )
{
document.write( "<tr>\r\n" );
for( var c = 0; c < colCount; c++)
{
document.write( "<td>" + r +"/" + c + "</td>" );
}
document.write( "</tr>\r\n" );
}
document.write( "</table><br>\r\n" );
}
</script>
</head>
<body>
<h1 id="ueberschrift" onClick="h1Click()">JavaScript Test </h1>
<script>
printTable( 5,3 );
printTable( 20,25 );
</script>
<script>
document.write("<p>Skript ist fertig!\r\n");
</script>
</body>
</html>