AddEventListener () and RemoveEventListener () are used to process the specified and delete event handler actions. Both methods are included in all DOM nodes, and they all accept 3 parameters: the name of the event to be processed, the function that is the event handler, and a Boolean value. Most of these Boolean parameters are true. Indicates that the event handler is called during the capture phase; Represents an event handler that is called during the bubbling phase.
<! DOCTYPE html>
because IE only supports event bubbling. So in most cases, the event handlers are added to the bubbling phase of the event stream to maximize compatibility with various browsers.It is best to add an event handler to the capture phase only when it needs to be intercepted before the event arrives at the target. Assumptions are not particularly needed. It is not recommended to register event handlers during the event capture phase.
How to handle JS binding events and removing events