开发者

Can a website pass focus to the browsers url field?

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜