Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. FocusEvent

FocusEvent

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

TheFocusEvent interface represents focus-related events, includingfocus,blur,focusin, andfocusout.

Event UIEvent FocusEvent

Constructor

FocusEvent()

Creates aFocusEvent event with the given parameters.

Instance properties

This interface also inherits properties from its parentUIEvent, and indirectly fromEvent.

FocusEvent.relatedTarget

AnEventTarget representing a secondary target for this event. In some cases (such as when tabbing in or out a page), this property may be set tonull for security reasons.

Instance methods

This interface has no specific methods. It inherits methods from its parentUIEvent, and indirectly fromEvent.

Order of events

When focus is shifted from element A to element B, focus events are dispatched in the following order:

  1. blur: sent after element A loses focus.
  2. focusout: sent after theblur event.
  3. focus: sent after element B receives focus.
  4. focusin: sent after thefocus event.

Specifications

Specification
UI Events
# interface-focusevent

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp