Closed zbrogz closed 3 years ago
Setting 'checked' programmatically (e.g. with setAttribute
) will set the checkbox to checked, so maybe the word "default" isn't the most descriptive either
The spec is a little wonky in my opinion, so I'm not totally sure what the description should be. I do think "default" or "initially" would be less confusing than "currently", however.
Note that the checked
attribute and checked
property are not always in sync (element.getAttribute('checked')
vs element.checked
). In other words, the checked attribute does not always reflect the currently selected radio.
Edit:
This is the wording in the spec:
The checked content attribute is a boolean attribute that gives the default checkedness of the input element.
Sorry, my bad, disregard my comment. The fact that setting it programmatically checks the checkbox, is perfectly compatible with the term "default".
I've fixed it in the docs https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio$revision/1653437
Perfect fix, thanks a lot @MendyBerger !
Request type
Details
The description for the radio input
checked
attribute is slightly off: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#checkedCurrently it says (emphasis added):
Per the HTML spec, it should instead say something like this: