A shipping form starts with option A. You choose B. If you haven't saved yet, Cancel changes should take you back to A. But after you save B and select A again, the same button should take you back to B. Which value is reset supposed to restore?
A browser reset does not undo the last click. It restores the input to its current default . I ran the same sequence on two forms, changing only one form’s default. The same native reset restored A in one and B in the other.
01 · CSS reads selection; reset reads the default
On a radio input, the HTML checked attribute supplies the default. The :checked selector matches current selection. In JavaScript, input.checked is current state and input.defaultChecked reflects the attribute. Click B when A has the attribute and the attribute can stay on A while CSS matches B.
The WHATWG rules for input state and reset track whether the user has changed the selection. Don’t assume that updating a default also updates a radio the user has already changed.…