Here's my fiddle :
I'm not sure to understand why this code is not working.
What I want to add +1 to the "ajout" variable when I click on the "+1" button. And if ajout = 5 (after 5 clicks)...then alert("Hello");
Why am I doing wrong?
Here's my code :
HTML :
<input type="button" onclick="clickit();" id="click1" value="+1"/>
JS :
var ajout = 0;
function clickit()
{
ajout +=1;
}
if (ajout==5)
{
alert("TEST");
}
Thank you!