Javascript jquery 1.4.4选中复选框if checked每次都返回true
我正在使用jQuery1.4.4和Trining来检查是否选中了此复选框Javascript jquery 1.4.4选中复选框if checked每次都返回true,javascript,jquery,checkbox,Javascript,Jquery,Checkbox,我正在使用jQuery1.4.4和Trining来检查是否选中了此复选框 <input type="checkbox" style="float:right" checked="" id="mainBond"> 您正在变为真实,因为您已将check=”“置于此处 如果您删除了它,它将显示为false。$(“#mainBond”).is(“:checked”)在jQuery 1.4.4中起作用:http://jsfiddle.net/LBKPG/1/ <input type="
<input type="checkbox" style="float:right" checked="" id="mainBond">
您正在变为真实,因为您已将check=”“置于此处 如果您删除了它,它将显示为false。
$(“#mainBond”).is(“:checked”)
在jQuery 1.4.4中起作用:http://jsfiddle.net/LBKPG/1/
<input type="checkbox" style="float:right" checked id="mainBond"> This one is true
<input type="checkbox" style="float:right" id="mainBond2"> This one is false
这是真的
这个是假的
这是因为它已被选中。选中的属性的值不重要。一旦它出现,盒子就会被检查
如果您不想检查该属性,只需删除该属性即可。您没有正确写入输入行。应该是:
它似乎在1.4.4中也能工作。以下是一个例子:
哪一个如果成功,请尝试单击该复选框并等待3秒钟,以查看是否为真,取消选中该复选框将显示为假
编辑:未保存示例。错误的链接
checked=""
<input type="checkbox" style="float:right" checked id="mainBond"> This one is true
<input type="checkbox" style="float:right" id="mainBond2"> This one is false