Using Bootstrap 3 and jQuery I have a checkbox like this(使用Bootstrap 3和jQuery我有一个复选框)
var eachrow = "<tr>" + "<td align='center'><input type='checkbox' class='case' name='case[]' value='1' type='checkbox'></td>"
+ "<td>Test</td>" + "</tr>";
$('#compValues').append(eachrow);
$("input:checkbox[name='case[]']").change(function(){
if($(this).is(':checked')){
alert("I am checked");
}
else{
alert("I am Unchecked");
}
});
Now the check box can be marked (checked or un-checked but the .change() function not doing any thing! no error or something else. Why is this happening?(现在可以选中该复选框(选中或未选中,但是.change()函数不执行任何操作!没有错误或其他错误。为什么会发生这种情况?)
ask by Mona Coder translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…