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?
<div id='foobar'>
<style>
.xl496
{
color:#336699;
}
</style>
<table>
<tr>
<td class='xl496'>Test:</td>
</tr>
</table>
</div>
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);