Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have set the html checkbox the checked property to false,but it still checked

Tags:

checkbox

input

here is my html markup:

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

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

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

Actually I want insert a input[type=checkbox] into html markup in dynamic, with parameter to determine checked or not

like image 619
hh54188 Avatar asked Jun 06 '12 02:06

hh54188


1 Answers

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.

If you don't want it checked, then do not include the checked attribute.

<input type="checkbox" />

See: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_checked

like image 153
Jeremy Goodell Avatar answered Oct 20 '22 01:10

Jeremy Goodell