0

HTML5

I'd like to somehow mark a visited link within the current page. Links are opened in a new tab.

The life of the marker is supposed to be till the page is reloaded.

Reason: it is a huge list of links. A wall of links of similarly looking links. I need a marker. And css "visited" pseudo class seems to be unsuitable here: it shows whether the link was visited at all, not the last visited link.

This is what seemed suitable:

<div>
    <label>
        <input type="radio" name="group">
        <a href="https://www.example.com" target="_blank">https://www.example.com</a>
    </label>
</div>

<div>
    <label>
        <input type="radio" name="group">
        <a href="https://www.example.com" target="_blank">https://www.example.com</a>
    </label>
</div>

Two problems:

  1. Radio button can be switched by clicking the marker itself rather than the link.
  2. It doesn't work at all: the marker is not switched when I click a link.

Could you help me with this. If this is a complete garbage of in idea, maybe there is something more elegant?

Michael
  • 4,273
  • 3
  • 40
  • 69

1 Answers1

0

Solved like this:

<label>
    <input type="radio" name="group" onclick="window.location='"https://www.example.com"';">
    https://www.example.com
</label>
Michael
  • 4,273
  • 3
  • 40
  • 69