class method Form.Element.focus

View source on GitHub →

Form.Element.focus(element) → Element

Gives keyboard focus to an element. Returns the element.

Example
Form.Element.focus('searchbox')
 // Almost equivalent, but does NOT return the form element (uses the native focus() method):
$('searchbox').focus()