JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<button class="example-1">CLICK ME</button>
<br><small>Will disable for 1 day seconds after clicking</small>
<br>
<button class="example-2">CLICK ME</button>
<br><small>Will hide for 1 day after clicking</small>
JavaScript
$(document).ready(function () {
$("button").click(function () {
var $this = $(this);
if ($this.is(".example-1")) {
$.cookie("button1", 1, {
expires: 1
});
$this.prop("disabled", true);
} else {
$.cookie("button2", 1, {
expires: 1
});
$this.hide();
}
});
if ($.cookie("button1")) {
$(".example-1").prop("disabled", true);
}
if ($.cookie("button2")) {
$(".example-2").hide();
}
});