I have a menu inside a masterpage (in a ASP.NET Web site), and i want to highlight active page in masterpage menu and submenus.
masterpage
HTML:
&l
$(function () { $(".navbar‐btn a").each(function () { var hreff = this.href.trim().split("/").splice(3, 4); if (hreff.length > 1) hreff.splice(0, 1); if (hreff[0] == window.location.pathname.split("/").splice(1, 1)[0]) $(this).parent().addClass("active"); }); })