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
idfield and usea#id:visitedwhen styling itYou could also use
classand select it witha.class:visited