I rarely use javascript and don’t even know if the following is possible. Maybe somebody can let me know?
I want to create a way of visually indicating to a user what page they are on. I want to do this by matching the text in the H1 tag of the page (there will only be one per page) with the text in an A (link) tag. If there is an exact match then a style will be applie to that particular a tag.
The problem is that the A tags will not IDs.
The script will be something like this:
Check for text match between H1 and A (link)
if there is a match then apply a style to the A tag that contains the text match.
–
Whilst i realised i can do this using css it will not work because i will not have controll of the site after it’s been built. Other people will come along and add page and that’s why i need an external js script that i can attach to all the pages to apply this rule.
Any help will be greatfully received.