In my code whenever we click this button counting apply on all user but I want each user to see their own button clicked count.
Is this possible in local storage or I have to use php ?function refreshDiv() {
if (localStorage.clickcount) {
localStorage.clickcount = Number(localStorage.clickcount) + 1;
} else {
localStorage.clickcount = 1;
}
document.getElementById("count").innerHTML = localStorage.clickcount;
}
<button id="txt-btn" class="dropdown-item" onclick="refreshDiv();">Save</button>
<table class="w3-table-all w3-card-4">
<tr>
<th>count</th>
</tr>
<tr>
<td id="count"></td>
</tr>
</table>