听起来有点像一个愚蠢的问题,但我想知道在HTML中检查/取消选中复选框的最佳方法是什么.
我见过很多不同的例子:
<input type="checkbox" checked="checked" />
<input type="checkbox" />
<input type="checkbox" checked="yes" />
<input type="checkbox" checked="no" />
<input type="checkbox" checked="true" />
<input type="checkbox" checked="false" />
Run Code Online (Sandbox Code Playgroud)
哪些浏览器可以使用哪些浏览器,最重要的是,jQuery会确定在所有3中检查哪个框?
编辑: W3C规范似乎暗示只有被检查的attr是正确的.这是否意味着checked ="false"和checked ="no"仍会检查该框?