1

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 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. :)

Federico Elles
  • 891
  • 3
  • 14
  • 24

1 Answers1

6

Nope you can't do it with your own code.

In most browsers though, the shortcut is Alt-D

Hulk1991
  • 3,079
  • 13
  • 31
  • 46
nickf
  • 537,072
  • 198
  • 649
  • 721