I am working on a button that contains numeric values and updates a total number displayed on the page when clicked. I would like this button to only be clickable once per day, so that users cannot click it multiple times within a 24 hour period. Below is an example of my HTML code. How can I achieve this functionality?
<div>Total : <span id="total">0</span></div>
<input class="add" data-amount="100" type="button" value="Add 100" />
$(document).ready(function() {
$('.add').click(function() {
$('#total').text(parseInt($('#total').text()) +
parseInt($(this).data('amount')));
});
})