There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

focus-on-previous

Syntax

focus-on-previous: (selector set) [end-of-field] [every (time)] [after (time)][, (element)...];

selector set = Any valid CSS selector referencing multiple elements.

end-of-field = after focus places the cursor at the end of the field, if the field handles text.

When this command is run, the selector set will be scanned, and if the currently focused element is found in there, it will change the focus to the previous element in the selector set.

When it gets to the beginning of the set, running this action command will take no further effect.

This command runs a JavaScript "focus" event.

Note: This won't work well with click events triggering this action. The reason being that when you click, you lose the current focus. It is no longer part of the selector set - the focus gets put onto the object you clicked on. So it is best used with keyboard events. We may expand this to remember the last input field focused so the command ignores the click focus, but for now just use it with keyboard events. Being able to move up and down a list with a key was the reason the command was made - we use it for our search results. To try that out, search and then move up and down the list with the arrow keys.

Also note that it will only work on elements that can receive focus.

focus-on-previous