I have a button that changes the body class to .blackout
For this, I am utilizing js-cookie library to manage cookies. The code snippet associated with my button is shown below:
<script>
$('#boToggle').on('click', function(e) {
$('body').toggleClass('blackout');
});
</script>
My dilemma lies in incorporating Cookies.set('name', 'value');
from the aforementioned link to set the cookie while toggling classes using .toggleClass and also how to retrieve the cookie data to apply it back as the body class.
Any assistance on this matter would be greatly appreciated!