I'm trying to select all visited links via jQuery. Here is the HTML
<div class="question-summary">
<a class="question-hyperlink">Stuff</a>
</div>
If question-hyperlink
has been visited, I was to select question-summary
. Any ideas?
To select all links inside paragraph element, we use parent descendant selector. This selector is used to selects every element that are descendant to a specific (parent) element.
You can parse all links on the page and and get their CSS color property. If a color of the link is a match to the color of unvisited link you defined in CSS the this link is unvisited. This kind of technique usually used to determine all visited links.
If it's deselected (by default), you are good. Go to Step 2. Step 2: Now go to Content > Fonts & Colors > Colors. In the “Colors” windows, change the color of “Visited Links:” to your desired one, select Always in the drop-down menu, and click the “OK” button to save your changes.
The :visited CSS pseudo-class represents links that the user has already visited. For privacy reasons, the styles that can be modified using this selector are very limited.
The given approach has been disabled for security reasons.
As it is possible to retrieve a visitor's history by checking for visited links, certain measures have been taken by browser vendors to prevent this.
Source: Mozilla Foundation Blog.
Checked in Chrome and FF - both don't support $("a:visited")
any longer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With