I'm using the jquery cookie plugin and I'm trying to have the browser remember the state of a CSS after a refresh, here's my code when a button is clicked:
$('#cartHolder').attr('style','display: none !important');
$.cookie("cartDisplay", 'none !important');
Then in my header I have:
if ($.cookie("cartDisplay")){
$('#cartHolder').attr('style', $.cookie("cartDisplay"));
}
The problem is, after each refresh the displayproperty is still reset back to it's default property. However in the console window I see that jquery cookie has successfully stored the necessary value, it's just not being written into the DOM after each refresh.
Any one able to help me out?
Thanks
none !important, you need to adddisplay: