jquery点击tr换背景颜色

jquery点击tr换tr的背景颜色,table的id为db-list1
jQuery(function() {
jQuery("#db-list1 tr").click(
function() {
if (jQuery(this).hasClass("selected")) {
jQuery(this).removeClass("selected");
jQuery(this).css("backgroundColor", "#ffffff");
jQuery(this).children().eq(1).children().attr('checked', false);
} else {
jQuery(this).addClass("selected");
jQuery(this).css("backgroundColor", "#b0d8ff");
jQuery(this).children().eq(1).children().attr('checked', true);
}
});
});
上一篇:CSS 实现左侧固定,右侧自适应两栏布局的方法


下一篇:wikioi 2235 机票打折 【考查浮点数四舍五入的技巧】