I am currently working on a jquery mobile page that includes a navigation menu in a sliding panel. While the functionality is good, I am looking to enhance the user experience by highlighting the selected link in the navigation.
Typically, I would utilize a class like ".selected" for this purpose.
However, for some reason, it does not seem to be working as expected in this scenario.
$('#navlist a').click(function() {
$('#navlist a').removeClass('selected');
$(this).addClass('selected');
});