title: detect visited link with jquery
body: <p>my css file has this</p>
  
  <pre><code>a:visited
  {
  color:red;
  }
  </code></pre>
  
  <p>and my html page has this</p>
  
  <pre><code>&lt;body&gt;
  &lt;a href="http://www.w3schools.com"&gt;W3Sschools&lt;/a&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;a href="http://www.wikipedia.org"&gt;Wikipedia&lt;/a&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;script&gt;
  if($("a:visited").length){
  $("a").next().html("this link is visited");
  }
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>but it doesn't work .. so i tried another alternative in the script area</p>
  
  <pre><code>&lt;script&gt;
  if($("a").css("color","red")){
  $("a").next().html("this link is visited");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>and it turns all my links in red even if they are not visited
  what's wrong with this !</p>