jQuery:使用复选框高亮显示行
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery:使用复选框高亮显示行相关的知识,希望对你有一定的参考价值。
The following code snippet will highlight the row in a table when the checkbox is checked. It will remove the highlight when the checkbox is unchecked. This will work for basic as well as a GridView.The "input:not(#selectAll)" will ignore the row that contains a SelectAll checkbox with the ID "selectAll".
Note: I had a css class defined as highlight where I set the background-color property.
$('#SurveyGrid input:not(#selectAll)').click(function () { if ($(this).attr("checked") == true) { $(this).parent().parent().addClass('highlight'); } else { $(this).parent().parent().removeClass('highlight'); } });
以上是关于jQuery:使用复选框高亮显示行的主要内容,如果未能解决你的问题,请参考以下文章