intro succes
This commit is contained in:
parent
02774af38c
commit
2b72155ee2
2 changed files with 4 additions and 7 deletions
|
@ -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>
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
Loading…
Reference in a new issue