-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
53 lines (44 loc) · 1.45 KB
/
Copy pathindex.html
File metadata and controls
53 lines (44 loc) · 1.45 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
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>JS Lab</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, serif;
}
h1 {
color: #0B3954;
}
</style>
</head>
<body>
<div id="app">
<h1 id="main-header">Moja aplikacja</h1>
<p>To będzie gra. A oto co muszę zrobić:</p>
<ol>
<li class="boring">Nauczyć się HTML</li>
<li class="boring">Nauczyć się CSS</li>
<li>Nauczyć się JS</li>
<li id="super-important">Zaimplementować</li>
</ol>
<button type="button" onclick="removeBoringStuff()">Usuń nudne rzeczy</button>
<input type="text" id="myTextField">
<input type="checkbox" id="myCheckbox">
<button type="button" onclick="readValues()">Odczytaj wartości</button>
</div>
<script>
alert('Witamy witamy');
function removeBoringStuff(){
document.querySelectorAll("#app .boring").forEach((e) => e.remove());
}
function readValues(){
const isCheacked = document.getElementById('myCheckbox').checked;
if (isCheacked){
alert(document.getElementById('myTextField').value);
};
}
</script>
</body>
</html>