I can't figure out why the code isn't functioning properly.
It was supposed to display the number of clicks on the button in the console each time it is clicked.
//Below is the code
let JoinButton = document.getElementById("join-button");
function Click(){
let count = 0;
count =+ 1;
if(count = 1){
console.log (`You have clicked ${count} time`);
}
else{
console.log (`You have clicked ${count} times`);
}
}
for (let i = 0; i = 10;){
JoinButton.onclick = Click();
i += 1;
}
console.log("You have reached the limit of clicking!");