-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopgave12.html
More file actions
52 lines (38 loc) · 2.03 KB
/
opgave12.html
File metadata and controls
52 lines (38 loc) · 2.03 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 lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css\common.css">
<title>Opgave 12</title>
<script src="javascript/opgave12.js"></script>
</head>
<body>
<div id="wrapper">
<h1 id="overskrift">Opgave 12: Array-øvelse 1</h1>
<p>Bemærk array'et i script-tag i head!</p>
<p id="foerste"></p>
<div id="alle">
</div>
<input type="button" value="Klik her for at udskrive værdierne i arrayet" id="knap" />
<div id="opgaven">
<h4>Opgaven</h4>
<ol>
<li>Når man klikker på knappen</li>
<li>... skal første værdi/item/value (Reol) udskrives i #foerste (uden brug af loop)</li>
<li>... og listen/arrayet skal LOOPES igennem og værdierne skal udskrives i #alle</li>
<li>Prøv evt. om du kan udskrive/loope værdierne ud i en html-liste ol eller ul ...</li>
</ol>
<p id="help" class="b">Få hjælp fx her:</p>
<ul>
<li><a href="https://www.tutorialspoint.com/javascript/javascript_arrays_object.htm" target="_blank">JavaScript - The Arrays Object</a></li>
<li><a href="https://www.w3schools.com/js/js_arrays.asp" target="_blank">JavaScript Arrays (se fx afsnittet "Access the Elements of an Array")</a></li>
<li><a href="https://www.w3schools.com/js/js_loop_for.asp" target="_blank">JavaScript For Loop</a></li>
<li><a href="https://www.w3schools.com/js/js_array_iteration.asp" target="_blank">Lidt anderledes måder at loope et array ud på: JavaScript Array Iteration Methods</a></li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach" target="_blank">Array.prototype.forEach()</a></li>
</ul>
</div>
</div>
</body>
</html>