autofocus HTML5 This Boolean attribute lets you specify that a form control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form element in a document can have the autofocus attribute, which is a Boolean. It cannot be applied if the type attribute is set to hidden (that is, you cannot automatically set focus to a hidden control).
Just add this attribute to the input box mdn link
Also I don’t understand why element.focus() is useless. It can't be solved without posting the code. It will be useful to write a test.
Just add this attribute to the input box
mdn link
Also I don’t understand why element.focus() is useless. It can't be solved without posting the code. It will be useful to write a test.
trigger, simulate click