我已经设置html复选框checked属性为false,但它仍然检查 [英] I have set the html checkbox the checked property to false,but it still checked

查看:915
本文介绍了我已经设置html复选框checked属性为false,但它仍然检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我的html标记:

here is my html markup:

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



我已将选中设置为false,但仍然检查结果

I have set the checked to false, but the result is still checked

为什么会发生这种情况?如果我删除checked属性,它会被取消选中。

Why this happened? If I remove the checked property, it would turn unchecked.

实际上我想插入一个输入[type = checkbox]

推荐答案

如果指定了checked,如果你说checked =false,checked =true,checked =checked或只是简单检查没有关系。

If you specify checked, then it is checked; it doesn't matter if you say checked="false", checked="true", checked="checked" or just plain checked.

<input type="checkbox" />

请参阅: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_checked

这篇关于我已经设置html复选框checked属性为false,但它仍然检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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