Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/405.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery 1.4.4选中复选框if checked每次都返回true_Javascript_Jquery_Checkbox - Fatal编程技术网

Javascript jquery 1.4.4选中复选框if checked每次都返回true

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="

我正在使用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="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
​