SyntaxFix
Write A Post
Hire A Developer
Questions
Only "keyboard focusable" elements can be focused with .focus(). div aren't meant to be natively focusable. You have to add tabindex="0" attributes to it to achieve that. input, button, a etc... are natively focusable.
.focus()
div
tabindex="0"
input
button
a