Closed
Bug 223003
Opened 22 years ago
Closed 21 years ago
Setting a checkbox to 'checked' with setAttribute after deselecting it manually doesn't show
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: mozilla, Unassigned)
References
Details
(Whiteboard: INVALID?)
Attachments
(1 file)
|
2.48 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030916
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030916
See attached testcase
Reproducible: Always
Steps to Reproduce:
See attached testcase
Actual Results:
Nothing
Expected Results:
Update my checkboxes
| Reporter | ||
Comment 1•22 years ago
|
||
Comment 2•22 years ago
|
||
I don't think this is valid. The "checked" HTML attribute and the "checked" DOM
attribute aren't the same thing. The first represents the initial state of the
control. The second represents the current state.
If you want to toggle the control's checked state, you want to use the DOM
attribute, as in:
myElement.checked = true;
Component: DOM Core → DOM HTML
Whiteboard: INVALID?
| Reporter | ||
Comment 3•22 years ago
|
||
Maybe I'm confused, but shouldn't the browser render the current state of the DOM?
Comment 4•22 years ago
|
||
It does. The DOM contains a "checked" DOM attribute as well as the HTML
attribute. The former is the visible state, the latter is the original state,
and what resetting the form would change the checkbox to. (Otherwise, how does
the browser know how to reset the form?)
I'm not sure though, hence my waiting for someone else to decide.
Comment 5•22 years ago
|
||
jst, this one is your call... This is just like the "value" thing, basically,
and DOM HTML says:
checked of type boolean
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.
so the property and attribute are in fact pretty decoupled in the DOM....
Comment 6•21 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Comment 7•19 years ago
|
||
*** Bug 327020 has been marked as a duplicate of this bug. ***
Comment 8•19 years ago
|
||
*** Bug 327020 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•