title: Javascript Find The Colour Of Link
body: <p>So the issue I'm having basically comes down, I have a list of external websites in HTML (as seen below).</p>
  
  <pre><code>&lt;a id="listitem0" href="http://google.com.au/"&gt;http://google.com.au/&lt;/a&gt;&lt;br /&gt;
  &lt;a id="listitem1" href="http://stackoverflow.com/"&gt;http://stackoverflow.com/&lt;/a&gt;&lt;br /&gt;
  &lt;a id="listitem2" href="http://kbbdigital.com.au/"&gt;http://kbbdigital.com.au/&lt;/a&gt;&lt;br /&gt;
  &lt;a id="listitem3" href="http://netreach.com.au/"&gt;http://netreach.com.au/&lt;/a&gt;&lt;br /&gt;
  </code></pre>
  
  <p>And some of them I have visited &amp; others I haven't, so I have CSS styling to help identify the visited vs not visited (as seen below).</p>
  
  <pre><code>&lt;style type="text/css"&gt;
      a {
      color:#999999;
      background-color:#000;
  }
  
  a:visited {
      color:#00FF00;
      background-color:#30F;
  }
  &lt;/style&gt;
  </code></pre>
  
  <p>Visually I can see which websites have &amp; haven't been visited, but when I run a basic javascript line it can't pick up the colour of the text or the background colour (code below), it just provides blank output.</p>
  
  <pre><code>&lt;script type="application/javascript"&gt;
  alert(document.getElementById("listitem0").style.backgroundColor);
  alert(document.getElementById("listitem0").style.color);
  &lt;/script&gt;
  </code></pre>
  
  <p>Does anyone know why it can't pick up the colour of the text based on the CSS set earlier? And is there solution to get this?</p>
  
  <p>I'm using Firefox 27.0.1 to run these tests, but have tried other browsers as well, but receive the same issue.</p>