【发布时间】:2018-06-23 15:11:48
【问题描述】:
当未选中复选框时,我正在尝试使用 JQuery 将行的颜色更改为灰色。我正在尝试使用这个 CSS 类,并从 JQuery 中调用它。但是,我没有收到任何错误,并且行颜色没有改变。如何更改“取消选中”复选框上的行颜色?
<script>
$(document).ready(function () {
$(".Grid input:checkbox").each(function () {
this.onclick = function ()
{
if (!this.checked)
{
$(this).closest('tr').css('grdCell');
}
}
})
$('.Grid').find("input:checkbox").prop('checked', true);
});
</script>
.grdCell {
background-color: Gray;
}
【问题讨论】:
标签: jquery css asp.net gridview