Used a method to create some +1 and -1 buttons on a page. (Like a scoreboard)
jQuery - Increase the value of a counter when a button is clicked
However I'm looking for a way to sync the results so that they don't go back to default after each refresh.
Any ideas?
<span id="output">-99</span>
<button class="button right" id="target" type="button">+</button>
<button class="button right" id="targetminus" type="button">-</button>
$('#target').click(function() {
$('#output').html(function(i, val) { return val*1+1 });
});
$('#targetminus').click(function() {
$('#output').html(function(i, val) { return val*1-1 });
});