-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
81 lines (77 loc) · 2.73 KB
/
index.html
File metadata and controls
81 lines (77 loc) · 2.73 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
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JavaScript Loops</title>
<link rel="stylesheet" href="styles.css" />
<script src="app.js" defer></script>
</head>
<body>
<!-- JavaScript Calculator -->
<h1>JavaScript Loops in Action</h1>
<section id="calculator">
<h2>JavaScript Calculator</h2>
<p>
Determine the sum of all numbers (beginning at zero) up to a number of
your choice.
</p>
<div class="control">
<label for="user-number">Your Number</label>
<input type="number" id="user-number" />
</div>
<button>Calculate Sum</button>
<p id="calculated-sum" class="output"></p>
</section>
<!-- Highlight Links -->
<section id="highlight-links">
<h2>Highlight Links</h2>
<button>Highlight all links in the text</button>
<p>
This is some text that also contains useful links (like
<a href="">this one</a> that actually lead nowhere. They lead nowhere
because this text and example is <strong>not</strong> about the anchor
elements or the link destinations but instead about JavaScript.
</p>
<p>
Because you can use
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"
>JavaScript</a
>
(okay, this link actually <strong>does</strong> lead somewhere) not just
for funny demos or useless examples but for real useful things - like
highlighting all the links in a text.
</p>
<p>
You can dive even deeper into JavaScript with one of our bestselling,
deep-dive, JavaScript-focused
<a href="https://academind.com/courses/">courses</a>.
</p>
</section>
<!-- User Information -->
<section id="user-data">
<h2>Your Information</h2>
<button>Display User Data</button>
<ul id="output-user-data"></ul>
</section>
<!-- Statistics / Roll The Dice -->
<section id="statistics">
<h2>Statistics</h2>
<p>
Test your luck and find out how many dice rolls (1-6 dice) it takes you
to roll a certain number (between 1 and 6).
</p>
<div class="control">
<label for="user-target-number">Your Target Number</label>
<input type="number" min="1" max="6" id="user-target-number" />
</div>
<button>Roll the Dice</button>
<ol id="dice-rolls"></ol>
<p>
It took you <span id="output-total-rolls" class="output">X</span> rolls
to roll a <span id="output-target-number" class="output">Y</span>.
</p>
</section>
</body>
</html>