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);
}
});
});
相关文章
- vue+ elelment-ui +tree树形组件背景颜色的修改,点击节点背景颜色修改设置为其他颜色,或是样式不生效的原因
- jquery实现导航栏鼠标点击后实行背景高亮,点击离开恢复(超级简单!!!!),jquery导航栏
- 取消a标签或者onclick在移动端点击时的背景颜色
- iOS开发之--如何修改TabBarItem的title的字体和颜色/BarButtonItem的title的字体大小和颜色/添加背景图片,并添加点击方法
- jquery之css()改变字体大小,颜色,背景色
- android listview内的TextView会在点击item的时候灰变背景颜色
- 使用jQuery单击链接时更改链接背景颜色
- 单击td中的img时更改tr背景颜色
- 在jQuery中单击时获取背景颜色
- 当切换按钮点击时如何改变背景颜色?