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);
}
});
});
相关文章
- html+jquery/js+css 实现Table tr鼠标悬停/点击出现弹窗,显示表格行数据
- 原生JS点击事件(点击对应的标签可以改变其背景颜色)
- jquery鼠标点击改变控件的背景颜色
- jquery动态改变背景颜色插件
- vue+ elelment-ui +tree树形组件背景颜色的修改,点击节点背景颜色修改设置为其他颜色,或是样式不生效的原因
- jquery实现导航栏鼠标点击后实行背景高亮,点击离开恢复(超级简单!!!!),jquery导航栏
- 取消a标签或者onclick在移动端点击时的背景颜色
- iOS开发之--如何修改TabBarItem的title的字体和颜色/BarButtonItem的title的字体大小和颜色/添加背景图片,并添加点击方法
- jquery之css()改变字体大小,颜色,背景色
- android listview内的TextView会在点击item的时候灰变背景颜色