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); } }); });

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM