DOMParser - get element style
<p>I'm trying to get a style property of an element that I parse with DOMParser. The 2 console.logs come up empty though. Any idea why this happens? </p>

<pre><code>&lt;div id='foobar'&gt;
  &lt;style&gt;
  .xl496
    {
    color:#336699;
    }
  &lt;/style&gt;

  &lt;table&gt;
   &lt;tr&gt;
    &lt;td class='xl496'&gt;Test:&lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
&lt;/div&gt;
</code></pre>

<hr>

<pre><code>var data = document.getElementById("foobar");

var parser = new DOMParser();
var doc = parser.parseFromString(data.innerHTML, "text/html");
var cols = doc.getElementsByTagName("tr");
var col = cols[0];
var tds = col.getElementsByTagName("td");
var td = tds[0];

console.log(getComputedStyle(td).getPropertyValue("color"));
console.log(td.style.color);
</code></pre>