Difference between the javascript/jQuery events “focus” and “focusin”?

后端 未结 3 1795
庸人自扰
庸人自扰 2021-02-02 07:03

What is the difference between these two events: focus and focusin?

相关标签:
3条回答
  • 2021-02-02 07:43

    The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling).

    http://api.jquery.com/focusin/

    0 讨论(0)
  • 2021-02-02 07:50

    According to the jQuery focusin documentation:

    The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling).

    0 讨论(0)
  • 2021-02-02 08:01

    The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event, in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling).

    This event will likely be used together with the focusout event.

    0 讨论(0)
提交回复
热议问题