I made a simple Chrome extension - search with a form.
When I open the extension, there is no default focus on form, but it requires additional click.
Focus is suppose to happen on popup.html form.
Now JavaScript .focus() method didn't work, Is there any other way to set default focus for Chrome extensions?
HTML:
<input type="text" id="mydata" />
JS:
document.getElementById('mydata').focus();
the latest chrome has supported tabindex attribute. So you can use
<input type="text" id="mydata" tabindex="1" />
to make it work without any js codes. just FYI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With