Compare commits
4 Commits
feat/css-c
...
f34980e28f
| Author | SHA1 | Date | |
|---|---|---|---|
| f34980e28f | |||
|
|
e5e23caab8 | ||
|
|
21bb6add65 | ||
|
|
c39968865c |
@@ -13,7 +13,7 @@
|
|||||||
<h1>Secret Santa</h1>
|
<h1>Secret Santa</h1>
|
||||||
|
|
||||||
<select id="person">
|
<select id="person">
|
||||||
<option selected disabled>Who are you?</option>
|
<option selected disabled>Qui es-tu?</option>
|
||||||
__OPTIONS__
|
__OPTIONS__
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -70,6 +70,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("person").addEventListener("change", (event) => {
|
document.getElementById("person").addEventListener("change", (event) => {
|
||||||
|
if (
|
||||||
|
window.confirm(
|
||||||
|
`Vérification! Tu es ${event.target.value}, c'est bien ça?`
|
||||||
|
)
|
||||||
|
) {
|
||||||
const options = {
|
const options = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
@@ -83,9 +88,10 @@
|
|||||||
.then((text) => {
|
.then((text) => {
|
||||||
document.getElementById(
|
document.getElementById(
|
||||||
"result"
|
"result"
|
||||||
).textContent = `Your draw: ${text}`;
|
).textContent = `Hoho! Tu as pioché ${text} ;`;
|
||||||
document.getElementById("person").remove();
|
document.getElementById("person").remove();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user