$(function () { $("tr td:odd").css("color", "red");//Start from index 0, index odd $("tr td:even").css("color ", "green");//Start from index 0, index even number $("tr td:eq(1)").css("background-color", "red");//Start from index 0, select The element whose index value is equal to eq() $("tr td:gt(1)").css("background-color", "blue");//Starting from index 0, $("tr td:contains('1')").css("background-color", "blue");//Select the element that contains text 1 $("tr td:has(span)").css("background- color", "blue");//Select the element that contains the span tag })
JQuery common filters
Guess you like
Origin blog.csdn.net/Charles_hui/article/details/108842087
Ranking