Prevent new game button from reloading page

This commit is contained in:
Manuel Thalmann 2022-12-15 00:43:27 +01:00
parent 399fa7257c
commit 602d8b4d6f
No known key found for this signature in database
GPG key ID: 5FD9AD3CCDDBD27B

View file

@ -65,8 +65,9 @@ function initialize()
game = new Game("game"); game = new Game("game");
game.initialize(); game.initialize();
(/** @type {HTMLElement} */ (document.querySelector(".new-game"))).onclick = () => (/** @type {HTMLElement} */ (document.querySelector(".new-game"))).onclick = (event) =>
{ {
event.preventDefault();
game.reset(); game.reset();
}; };