jQuery遍歷table並操作元素

//遍歷id爲“table_id”的table的所有行
$("#table_id").find("tr").each(function() {
        //獲取第5列的元素
       var element = $(this).children('td:eq(5)');	
        //將第9列的元素的顏色設爲紅色
$(this).children('td:eq(9)').css("color", "red");
});


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章