查看了 HTML 规范,但无法理解它的正反面:http://www.w3.org/TR/html5/the-input-element.html#attr-input-checked
在 HTML 中检查复选框的正确方法是什么(不是动态的)?
checked="true"
checked="checked"
取消选中复选框的正确方法是什么?
<input type="checkbox" /> with no checked attribute
checked="false"
checked="none"
在哪里检查 HTML 规范以选中/取消选中复选框?
最佳答案
选中状态
旧版浏览器可能需要:
<input type="checkbox" checked="checked" />
但现在只需这样做:
<input type="checkbox" checked />
对于未选中状态
删除选中的属性,例如:
<input type="checkbox" />
Reference: http://www.w3.org/TR/html-markup/input.checkbox.html#input.checkbox.attrs.checked
关于html - 在 HTML5 中选中和取消选中复选框的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12700626/