Why `autofocus` instead of `button.focus()` in this case? `autofocus` is only useful as an HTML attribute, not dynamically.
-
-
But why does it work the first time then?
@bdc -
Since the JS executes right away (and not on e.g. document ready) step 9 of https://html.spec.whatwg.org/multipage/forms.html#autofocusing-a-form-control:-the-autofocus-attribute … applies, I think +
@bdc
End of conversation
New conversation -
-
-
Ah yeah that works. But, to my initial question: do you know why Safari handles autofocus differently than other browsers?
-
I don’t, no — please file a WebKit bug!
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.