I have a navigation with 2 buttons, when clicking a button it loads a new page (new page load), when clicking the button, a class with classname selected should be added... It does that partially - It add's the class, but when it loads the new page, the class is removed again? How do I make the class stick to what the user has clicked?
$(document).on("click", ".list-mode button", function () {
$(".list-mode button").removeClass("selected");
$(this).addClass("selected");
});