I was searching for a simple html code for button clicker counter and I found this site
However, I need the clicks to be anti-spam so I just need a button that allows only one click per IP address.
Help?
Here's the code:
function clickCounter() {
if(typeof(Storage) !== "undefined") {
if (localStorage.clickcount) {
localStorage.clickcount = Number(localStorage.clickcount)+1;
} else {
localStorage.clickcount = 1;
}
document.getElementById("result").innerHTML = "" + localStorage.clickcount + " people are going!";
} else {
document.getElementById("result").innerHTML = "Sorry, your browser does not support web storage...";
}
}
<body>
<p><button onclick="clickCounter()" type="button">I'M GOING!</button></p>
<div id="result"></div>