Element: focus/blur event

The focus event fires when an element has received focus. The main difference between this event and focusin is that focusin bubbles while focus does not.

The opposite of blur is focus.

Example

Element: focusin/focusout event

The focusin event fires when an element is about to receive focus. The main difference between this event and focus is that focusin bubbles while focus does not.

The opposite of focusin is focusout.

Example