HTML DOM: Which events do not bubble?

前端 未结 5 1688
予麋鹿
予麋鹿 2020-11-28 07:47

Most events bubble in all browsers. However, I know that in Internet Explorer \"submit\" events do not bubble. What are the other events that do not bubble?

相关标签:
5条回答
  • 2020-11-28 08:27

    Any events specific to one element do not bubble: focus, blur, load, unload, change, reset, scroll, most of the DOM events (DOMFocusIn, DOMFocusOut, DOMNodeRemoved, etc), mouseenter, mouseleave, etc

    0 讨论(0)
  • 2020-11-28 08:27

    HTML frame/object

    • load
    • unload
    • scroll (except that a scroll event on document must bubble to the window)

    HTML form

    • focus
    • blur

    Mutation

    • DOMNodeRemovedFromDocument
    • DOMNodeInsertedIntoDocument

    Progress

    • loadstart
    • progress
    • error
    • abort
    • load
    • loadend

    From: https://en.wikipedia.org/wiki/DOM_events#Events

    0 讨论(0)
  • 2020-11-28 08:32

    I can't list all the events that do not bubble.

    But I find a good site that can help you to check if the events can bubble or not.

    @MDN event.bubbles

    0 讨论(0)
  • 2020-11-28 08:43

    In addition to the rest answers, the load event on document elements bubbles, but it stops bubbling at the Document object and does not propagate on to the Window object. The load event of the Window object is triggered only when the entire document has loaded.

    0 讨论(0)
  • focus and blur events do not bubble

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