I'm studying the checkbox at jQuery UI.
Q: Why does clicking on the toggle button not toggle the "checked" attribute?
I'm studying the checkbox at jQuery UI.
Q: Why does clicking on the toggle button not toggle the "checked" attribute?
Just looking at Firebug isn't going to be enough to determine if the checked property on the relevant DOM element is set to true or false. In other words, just because the source viewer in Firebug doesn't show <input checked='checked' /> doesn't mean the checkbox isn't checked.
For the official explanation, check out the W3 link above. Under the documentation for the checked property, you'll see:
When the type attribute of the element has the value "radio" or "checkbox", this represents the current state of the form control, in an interactive user agent. Changes to this attribute change the state of the form control, but do not change the value of the HTML checked attribute of the INPUT element.
For the proper test, type the following in the console after clicking the button a few times:
$("#check").prop("checked");
Also, if you submit a form and the checkbox is a successful control, I promise the correct value of #check will be posted.