find the value of table

如果想要找一个table中的某个td值

var t=document.getElementById('tbody');
var rows=t.rows;
for(var i=0;i<rows.length;i++){
    var cell=rows[i].cells[1];
        if(cell.innerHTML<60){
            rows[i].bgColor='#ff3333';
        }
        else{
            rows[i].bgColor='green';
        }
}

这是js代码,其中”tbody”是tbody的id

详细代码

click here


find the value of table
https://zhangfuli.github.io/2016/10/05/find-the-value-of-table/
作者
张富利
发布于
2016年10月5日
许可协议