()
| 52 | } |
| 53 | //game over |
| 54 | function gameOver() { |
| 55 | endgameEl.innerHTML = ` |
| 56 | <h1>Time ran out</h1> |
| 57 | <p>Your final score is ${score}</p> |
| 58 | <button onclick="location.reload()">Restart</button> |
| 59 | `; |
| 60 | endgameEl.style.display = "flex"; |
| 61 | } |
| 62 | //event |
| 63 | text.addEventListener("input", (e) => { |
| 64 | const insetedText = e.target.value; |