📅  最后修改于: 2022-03-11 15:01:17.806000             🧑  作者: Mango
var rows = document.getElementById("trans_separate").getElementsByTagName("tbody")
[0].getElementsByTagName("tr");
// loops through each row
for (i = 0; i < rows.length; i++) {cells = rows[i].getElementsByTagName('td');
if (cells[0].innerHTML == 'R')
rows[i].className = "red";
if (cells[0].innerHTML == 'Y')
rows[i].className = "yellow";
}