-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (94 loc) · 3.13 KB
/
index.html
File metadata and controls
112 lines (94 loc) · 3.13 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Skip to content Search or jump to… Pull requests Issues Marketplace Explore
@moueza CarZR / NSIweb Public Code Issues Pull requests Actions Projects Wiki
Security Insights NSIweb/index.html @CarZR CarZR Update index.html Latest commit
57ea528 5 days ago History 1 contributor 120 lines (88 sloc) 2.49 KB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>JS Bin</title>
</head>
<body>
<h1>Site internet de ZAF</h1>
<h2>Choses que vous trouverez dans ce site:</h2>
<ul>
<li>Des informations</li>
<li>Des cours</li>
<li>Des fiches de révision</li>
</ul>
<table>
<thead>
<tr>
<th>Propriétaire</th>
<th>Sources</th>
</tr>
</thead>
<tbody>
<tr>
<td>Carla</td>
<td>GitHub</td>
</tr>
</tbody>
</table>
<h2>Liste de courses</h2>
<fieldset>
<legend><b> Qui êtes-vous ? </b></legend>
<p></p>
<input type="name" id="nom" name="name" value="taper votre prénom" />
<p></p>
<legend>Selectionner votre budget :</legend>
<form>
<select name="budget" size="1">
<option>0-10</option>
<option>11-50</option>
<option>51 et +</option>
</select>
</form>
<p></p>
<legend>Fruits</legend>
<div>
<input type="checkbox" id="Abricot" name="fruit" value="Abricot" />
<label for="Abricot">Abricot</label>
</div>
<div>
<input type="checkbox" id="Banane" name="fruit" value="Banane" />
<label for="Banane">Banane</label>
</div>
<div>
<input type="checkbox" id="Poire" name="fruit" value="Poire" />
<label for="Poire">Poire</label>
</div>
<div>
<input type="checkbox" id="Pomme" name="fruit" value="Pomme" />
<label for="Pomme">Pomme</label>
</div>
</fieldset>
<p></p>
<button id="button">Valider</button>
<div id="res"></div>
<script>
function funi() {
var elt = document.getElementById("res");
elt.innerHTML = "OK";
console.log("AbricotChecked" + nom1.checked);
}
var nom1 = document.getElementById("Abricot");
// let b1 = document.querySelector("button");
var b1 = document.getElementById("button");
b1.addEventListener("click", funi);
var nom2 = document.getElementById("nom");
let b2=document.querySelector('button');
b1.addEventListener('click',function(){alert('Validation confirmée, merci '+nom2.value)})
</script>
<div id="res"></div>
</body>
</html>
<!--
https://www.toutjavascript.com/reference/ref-window.document.getelementsbyname.php
https://www.zonecss.fr/cours-css-javascript/les-selecteurs-javascript.html#element-getelementsbytagname
https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Array/push
https://openclassrooms.com/forum/sujet/object-htmlinputelement-object-htmlinputelement
© 2022 GitHub, Inc. Terms Privacy Security Status Docs Contact GitHub Pricing
API Training Blog About Loading complete
-->