diff --git a/index.html b/index.html index 773587e..885774b 100755 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Prog Web Legend -

Ecris une ligne

+

Click

diff --git a/js/intro.js b/js/intro.js index 2663134..0e03944 100644 --- a/js/intro.js +++ b/js/intro.js @@ -1,13 +1,10 @@ -let firstclick = 0 +document.addEventListener("click",firstClick) -if (firstclick==0){ - document.addEventListener("click",button) - firstclick = 1 -} -function button(){ +function firstClick(){ const click = document.createElement("button") click.innerText="click" document.body.appendChild(click) + document.removeEventListener("click",button) } \ No newline at end of file