MattjeS
MattjeS

Reputation: 1397

autofocus attribute on input field not working in IE 11

I can't seem to get this working in IE 11, I've created an extremely simple jsfiddle: http://jsfiddle.net/0qwbr7gh/ With the following input box:

<input type="text" autofocus/>

In chrome it works as expected, the input field has focus on load. In IE 11 it doesn't.

Microsoft say it's supported on their website along with an example. And also it says it's supported on: http://caniuse.com/#feat=autofocus

What have I missed?

Upvotes: 6

Views: 5942

Answers (2)

anevaude
anevaude

Reputation: 111

Well it's 2019, and IE11 is still bad at supporting autofocus. I was using AngularJS and the only thing that worked was this:

https://myplanet.github.io/angular-auto-focus/

Upvotes: 0

Tales Viegas
Tales Viegas

Reputation: 56

IE11 doesn`t support autofocus (despite is in caniuse). You can check How to make input autofocus in internet explorer?

Upvotes: 4

Related Questions