Css class on hyperlink query

Hi,

I have noticed on this site:

That the HTML of each of the name suggestions is e.g. like this:

<a target=“blank” rel=“nofollow” href=‘http://…’>NoamA1</a>

But if you click on any of the name suggestion links, the little blue star changes to orange.

If I inspect the HTML in FireBug, it shows this:

<a target=“blank” rel=“nofollow” class=“active” href=‘http://…’>NoamA1</a>

I just wondered how the class of the link is changed on the link being clicked.

I realise it might be JavaScript, so apologies if so, for posting in the wrong forum.

Any advice much appreciated.

Thanks

No, in normal circumstances this is handled by server-side code, such as PHP. If you are using a content management system, the system inserts that class when the page URL matches the link URL. You can do it manually on a static site, but it’s not very efficient. An alternative is to use CSS, as explained here:

There are some other solutions in that thread, too, which are worth a look. One is to highlight the links with JavaScript, though the downside of this is that it won’t work if the user has JS off.