I'm trying to restart the function non() with the if statement inside. I have looked at other sources and none of them seem to work. here is my code. It's in French btw.
var click = 9;
function non() {
var i;
var message = document.getElementById("message");
//Affiche un message chaque fois que le bouton non //estcliquer
for (i = 0; i < 1; i++) {
message.innerHTML += "Es-tu près !!OUI!! ou !!NON!!<br>";
}
if (!(click--)) {
alert("Es-tu près");
non();
}
document.getElementById("boutonNon").click;
}
<div id="divNon">
<button class="bouton boutonOui" id="boutonNon"
onclick="non()" value="reset">Non</button>
</div>