HTML:
<tr id="header-row">
<th class="tableheaders" id="t_headersteamlink">steamlink</th>
<th class="tableheaders" id="t_headername">name</th>
<th class="tableheaders" id="t_headerbanned">banned?</th>
<th class="tableheaders" id="t_headerbandate">banDate</th>
<th class="tableheaders" id="t_headercreator">creator</th>
<th class="tableheaders" id="t_headercreationdate">creationDate</th>
</tr>
<tr class="datarow">
<td ><a href="https://steamcommunity.com/id/example">steamcommunity.com/id/example</a></td>
<td>exampleUser</td>
<td>yes</td>
<td>24/06/2021</td>
<td>exampleCreator</td>
<td>20/06/2021</td>
</tr>
JavaScript:
var table = document.getElementById("steamtable");
window.onload = function() {
for (var i = 0, row; row = table.rows[i]; i++) {
if (row.cells[2].innerText == "yes") {
row.cells[1].style.color = 'red';
row.cells[2].style.color = 'red';
row.cells[3].style.color = 'red';
}
}
}
So i'm trying to loop trough the table and if the cell containing the 'banned?' value equals 'yes' then i want change the url tag color of that row to red at all times (link, visited and hover).
Technically i know how to change the colors, i just dont know how to access the url tag in this scenario. The javascript i added just changes the colors of some cells, and that works totally fine.
any help would be appreciated.
url tag
means a tag?