I have a menu that uses SSIs, problem is the tag needs an id of “here” for CSS to apply background image to show the end user’s location on the site.
So is there a way to grab the browser’s current url (ie: mypage.html), use the .find() function select the anchor tag and add id=”here”?
I can see this working in concept but no matter what I try I can’t seem to get jQuery to do it.
Depending on if it’s a relative URL or not, something like
may work. This looks for
atags that have anhrefthat ends with the current pathname; that may not be restrictive enough for you.