当我单击复选框时,我需要在该特定行的下一列中添加图像。我对代码和目标 td
使用 addClass()
方法。然而,它无处不在。
你能告诉我如何解决吗?我在下面提供我的代码
http://jsfiddle.net/wj1z3dnp/6/
$(document).on('change', '#checkIDGrid', function() {
alert("I am inside change");
$("td").addClass("timeGrad1");
if (this.checked) {
var returnVal = confirm("Are you sure?");
$(this).prop("checked", returnVal);
}
// $('#textbox1').val(this.checked);
});
最佳答案
您正在将类添加到您所有的 td
元素中,尝试使您的选择器更加具体。
关于javascript - 单击我需要在该特定行的下一列中添加图像的复选框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49676981/