.focus()

jQuery

.focus()


.focus( delay [, callback ] ) Returns: jQuery

Description: Asynchronously set focus to an element.

  • .focus( delay [, callback ] )

    • delay
      Type: Integer
      The number of milliseconds to wait before setting focus.
    • callback
      Type: Function()
      A function to invoke after the element has been focused.

This plugin extends jQuery's built-in .focus() method. If jQuery UI is not loaded, calling the .focus() method may not fail directly, as the method still exists. However, the expected behavior will not occur.