I have the following code that should add an active css class to the menu item if menu item url == current url:
$("#accordion a").each(function()
{
if (this.href.search(window.location.hostname) != -1)
{
$(this).addClass("active-sidebar-link");
}
});
but this adds the class to all the menu items. any tips?