I am currently trying to make a navigation-menu where an active-class is applied to the anchors whose href attributes that match the c
navigation-menu
active-class
href
Give this code a shot, its something I put together for the company that I work for.
// highlight tab function var path = location.pathname; var home = "/"; $("a[href='" + [path || home] + "']").parents("li").each(function() { $(this).addClass("selected"); });