I am struck how to start counter with five digit counter. on button click. A request will go to server via ajax to store current value,so every time a new user will come if he press the button the counter will increase by 1.
00001
00002
.
00010
.
.
99999
$("#update").click(function() {
$('#counter').html(function(i, val) {
/*$.ajax({
url: '/path/to/script/',
type: 'POST',
data: {increment: true},
success: function() { alert('Request has returned') }
});*/
return + val+1;
});
});
<button id="update" type="button">Click Me</button>
<div id="counter">00000</div>