Difference between focusin/focusout and focus/blur, with example

后端 未结 2 1558
再見小時候
再見小時候 2020-12-02 17:09

Can anyone tell me the difference between blur and focusout, focus and focusin with a simple example?

2条回答
  •  醉话见心
    2020-12-02 17:46

    The focus and blur events keep track of the elements the user focuses on.

    1. focus

      Fires when a focusable element gains the focus

    2. blur

      Fires when a focusable element loses the focus

    3. focusin and focusout

      Fire at the same time as focus and blur, but bubble.

    for example check this

提交回复
热议问题