When a button is clicked, the code inside my .Post() function looks like this:
if (Comment != null && Grade > 0) {
$("navigation").attr('a[data-id="' + QuestionID + '"]')
.css({ "background-color": "green" });
} else if (Comment == null && Grade == null) {
$('a[data-id="' + QuestionID + '"]').css({ "background-color": "#D8D8D8" });
I noticed that when I close or refresh my web application, the color settings are lost. How can I make the background color stay permanently, even after closing or refreshing the page? Do I need to use addClass method or something similar?