「jQuery入門」テーブルの奇数、偶数の色を付けるサンプル
JSコード
$(“#tab tbody tr:odd").css(“background-color","#bbf");
$(“#tab tbody tr:even").css(“background-color","#fff");
$(“#tab tbody tr:odd").addClass(“odd");
$(“#tab tbody tr:even").addClass(“even");
Coding Changes the World
JSコード
$(“#tab tbody tr:odd").css(“background-color","#bbf");
$(“#tab tbody tr:even").css(“background-color","#fff");
$(“#tab tbody tr:odd").addClass(“odd");
$(“#tab tbody tr:even").addClass(“even");