Can I create a piece of code for my website which focuses the browser url bar (field) so I can directly start typing in a new url?
There could be for example a predefined hotkey which would execute this code.
Background: My (mouse-less) webapp steals the focus when loaded, so开发者_JAVA百科 keyboard shortcuts can work. Users requested a possibility to easily access the browser url bar by hitting the space key.
Even if it is not possible, I can answer now I tried anything possible. :)
Nope you can't do it with your own code.
In most browsers though, the shortcut is Alt-D
- Internet Explorer: Alt-D, F6
- Mozilla Firefox: Alt-D, F6, Ctrl-L
- Google Chrome: Alt-D, F6, Ctrl-L
- Opera: Alt-D, F8, Ctrl-L
- Safari (Mac): Command-L
精彩评论