diff --git a/game/index.html b/game/index.html index 25e07531a0785bbb4b4e3787b5f8f5a9341765d3..defe8f86a489e9aedd8f5d53821772d681b6123f 100644 --- a/game/index.html +++ b/game/index.html @@ -42,5 +42,5 @@ </main> </body> -<script src="./index.js"></script> +<script src="index.js"></script> </html> \ No newline at end of file diff --git a/game/index.js b/game/index.js index 24348cb8d189f89873986daa068be04ffd02e0ce..b058fabb3b55326e97e4fe30ad4e67a7c8fd0062 100644 --- a/game/index.js +++ b/game/index.js @@ -2,6 +2,9 @@ const options = ["Stein", "Papier", "Schere"]; let playerScore = 0; let computerScore = 0; + +const playerScoreElement = document.getElementById("player-score") + function getRandomComputerResult(){ const number = Math.floor(Math.random()*options.length); return options[number]; @@ -28,3 +31,5 @@ function getRoundResults(playerChoice){ return `Computer hat gewonnen! ${computerChoice} schlaegt ${playerChoice}`; } } + +console.log(playerScoreElement)