I am working on a page that includes a menu feature:
https://jsfiddle.net/dva4zo8t/
When a menu button is clicked, the color changes and I need to retain this color even after the page is reloaded:
$('[id*="button"]').click(function() {
$('.topmenu-ul li').removeClass();
$(this).addClass('topmenu-selected' + $('a', this).attr('class'));
});
Additionally, I want to maintain the highlight on the submenu link when the corresponding page loads. For example:
https://i.sstatic.net/FF7oZ.png
Essentially, I am looking to change the class of the submenu li similar to the main buttons, like this:
$('#redbutton').addClass('topmenu-selectedred');
$('.topmenu-tab-appointments').show();
Any suggestions or guidance on achieving this would be highly appreciated!