diff --git a/js/intro.js b/js/intro.js index 0e03944..10ca202 100644 --- a/js/intro.js +++ b/js/intro.js @@ -1,3 +1,4 @@ +let score = 0 document.addEventListener("click",firstClick) @@ -6,5 +7,18 @@ function firstClick(){ const click = document.createElement("button") click.innerText="click" document.body.appendChild(click) - document.removeEventListener("click",button) + + const scoreAff = document.createElement("output") + scoreAff.innerText="SCORE" + scoreAff.id = "score_affichage" + document.body.appendChild(scoreAff) + click.addEventListener("click",scoreCount) + document.removeEventListener("click",firstClick) + +} + +function scoreCount(){ + const scoreAff = document.getElementById("score_affichage") + score += 1 + scoreAff.innerText="SCORE : " + score } \ No newline at end of file