4 ms·
> Consider how some browsers will remember what you input into forms when you hit the back button: I think representing this as a cached version of the modified
by shiomiru 2y ago
> Consider how some browsers will remember what you input into forms when you hit
the back button: I think representing this as a cached version of the modified
DOM makes a lot more sense than whatever magic browsers currently use to
remember it.
That would not work either:
> A control's value is its internal state. As such, it might not match the
user's current input.
> For instance, if a user enters the word "three" into a numeric field that
expects digits, the user's input would be the string "three" but the control's
value would remain unchanged. Or, if a user enters the email address
" awesome@example.com" (with leading whitespace) into an email field, the
user's input would be the string " awesome@example.com" but the browser's UI
for email fields might translate that into a value of "awesome@example.com"
(without the leading whitespace).
From the standard: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#a-form-control's-value https://html.spec.whatwg.org/multipage/form-control-infrastr...