Browse Source

3.14159265358979323846264338327950288419719749

master
Arthur BARRAUX 2 years ago
parent
commit
30bbf01d96
  1. 18
      index.html
  2. 14
      script.js

18
index.html

@ -16,10 +16,20 @@
</script> </script>
<button onclick="rotate()">Tourner</button> <button onclick="rotate()">Tourner</button>
<h1 id="winner"></h1> <h1 id="winner"></h1>
<form name="myForm" action="/action_page.php" onsubmit="return validateForm()" method="post"> Ajouter quelqu'un: <input id="entry" type="text" name="fname">
Ajouter quelqu'un: <input id="entry" type="text" name="fname"> <input id="submit" type="submit" value="Submit">
<input id="submit" type="submit" value="Submit"> <ul id="list_person">
</form>
</ul>
<script>
document.getElementById('submit').addEventListener('click', function(event){
event.preventDefault();
names.push(document.getElementById('entry').value);
draw_roulette(200, 200, 200, names);
let new_element = document.createElement("li");
});
</script>
</body> </body>
</html> </html>

14
script.js

@ -66,18 +66,4 @@ function show_winner(winner){
h1.innerText = winner; h1.innerText = winner;
}; };
function validateForm() {
let x = document.forms["myForm"]["fname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
names.push(x);
draw_roulette(200,200,200, names);
}
document.getElementById('submit').addEventListener('click', function(event){
event.preventDefault();
names.push(document.getElementById("entry").innerText);
draw_roulette(200, 200, 200, names);
})

Loading…
Cancel
Save