intro succes

This commit is contained in:
Justine Beau 2024-11-21 11:26:25 +01:00
parent 02774af38c
commit 2b72155ee2
2 changed files with 4 additions and 7 deletions

View file

@ -6,7 +6,7 @@
<title>Prog Web Legend</title> <title>Prog Web Legend</title>
</head> </head>
<body> <body>
<p>Ecris une ligne</p> <p>Click</p>
<script src="./js/intro.js" deref></script> <script src="./js/intro.js" deref></script>
<script src="./js/element.js"></script> <script src="./js/element.js"></script>
</body> </body>

View file

@ -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") const click = document.createElement("button")
click.innerText="click" click.innerText="click"
document.body.appendChild(click) document.body.appendChild(click)
document.removeEventListener("click",button)
} }