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

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

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

3条回答
  •  清歌不尽
    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).

提交回复
热议问题