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)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mozilla, Unassigned)

References

Details

(Whiteboard: INVALID?)

Attachments

(1 file)

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
Attached file Testcase
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?
Maybe I'm confused, but shouldn't the browser render the current state of the DOM?
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.
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....
This is invalid, per comment 4 and comment 5.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
*** Bug 327020 has been marked as a duplicate of this bug. ***
*** Bug 327020 has been marked as a duplicate of this bug. ***
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: