divText += '<div class="single-article"> ';
divText += '<h2><a href="#" onClick="javascript:displayArticleDetail('+json._embedded.articles[i].articleId+', \''+escapedLinkTitle+'\'); setVisited();" \>'+json._embedded.articles[i].title+'</a> ';
I need some assistance setting the color of a visited link. Having some trouble with this. I cannot use pure CSS :visited
because this goes and changes the link color of every single link, not just the visited (clicked).
How would I go about doing this with Javascript?
You need to give more specificity to that anchor tag.
Try giving it an
id
field and usea#id:visited
when styling itYou could also use
class
and select it witha.class:visited