In web browsers, what's the difference between onblur and onfocusout?

前端 未结 5 1531
一向
一向 2020-12-02 21:59

If they\'re the same, then why there are two of this kind of event?

5条回答
  •  醉酒成梦
    2020-12-02 22:23

    There's essentially no difference in 2017:

    https://www.quirksmode.org/js/events_order.html

    Few web developers consciously use event capturing or bubbling. In Web pages as they are made today, it is simply not necessary to let a bubbling event be handled by several different event handlers. Users might get confused by several things happening after one mouse click, and usually you want to keep your event handling scripts separated.

提交回复
热议问题