Currently, I am utilizing the jquery cookie plugin to make the browser remember the state of a CSS after refreshing the page. Below is an excerpt of my code where a button is clicked:
$('#cartHolder').attr('style','display: none !important');
$.cookie("cartDisplay", 'none !important');
In my header section, I have the following:
if ($.cookie("cartDisplay")){
$('#cartHolder').attr('style', $.cookie("cartDisplay"));
}
The issue I'm facing is that after each refresh, the display
property goes back to its default value. Despite successfully storing the required value using jquery cookie (as seen in the console window), it does not update the DOM upon refresh.
If anyone could provide assistance, I would greatly appreciate it.
Thank you