在HTML5中检查和取消选中复选框的正确方法是什么? [英] What is the proper way to check and uncheck a checkbox in HTML5?

查看:148
本文介绍了在HTML5中检查和取消选中复选框的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看了HTML规范,但无法制作头部或尾部: http://www.w3.org/TR/html5/the-input-element.html#attr-input-checked

Looked at the HTML spec, but couldn't make heads or tails of it: http://www.w3.org/TR/html5/the-input-element.html#attr-input-checked

在HTML中(不是动态地)检查复选框的正确方法是什么?

What is the correct way to check a checkbox in HTML (not dynamically)?

checked="true"
checked="checked"

复选框?

<input type="checkbox" /> with no checked attribute
checked="false"
checked="none"

推荐答案

<input type="checkbox" checked="checked" />

或简单

<input type="checkbox" checked />


未选中复选框的未选中属性(< input type =checkbox/> )。

参考: http://www.w3.org/ TR / html-markup / input.checkbox.html#input.checkbox.attrs.checked

这篇关于在HTML5中检查和取消选中复选框的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆