Browse Source

3.141592653589793238462643383279502884197197

master
quegzacov 2 years ago
parent
commit
0457ead04a
  1. 4
      index.html
  2. 6
      script.js

4
index.html

@ -17,8 +17,8 @@
<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"> <form name="myForm" action="/action_page.php" onsubmit="return validateForm()" method="post">
Ajouter quelqu'un: <input type="text" name="fname"> Ajouter quelqu'un: <input id="entry" type="text" name="fname">
<input type="submit" value="Submit"> <input id="submit" type="submit" value="Submit">
</form> </form>
</body> </body>
</html> </html>

6
script.js

@ -75,3 +75,9 @@ function validateForm() {
names.push(x); names.push(x);
draw_roulette(200,200,200, names); 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