I have a page with the following menu:

<https://jsfiddle.net/dva4zo8t/>

Based on which menu button is clicked, the color changes and I can "remember" (set) the color on a new page load, like so:

```
$('[id*="button"]').click(function() {
    $('.topmenu-ul li').removeClass();
    $(this).addClass('topmenu-selected' + $('a', this).attr('class'));
});

```

I also want to set a style to the LI element (a different background color and a red highlighted text) once the page loads. So, when I click on "New Appointment", on the new page, the LI element should look like this:

[![example](https://i.stack.imgur.com/FF7oZ.png)](https://i.stack.imgur.com/FF7oZ.png)

So what I basically want is to change the class of the sub li just as I do with the main buttons, for example:

```
$('#redbutton').addClass('topmenu-selectedred');
$('.topmenu-tab-appointments').show();

```