About Event Summary

The element binding events:

  1. Event Object Type = .on event handler;
  2. IE8 does not support object .addEventListener (not on the event type, event handler, false); The third parameter is used to control the bubbling phase of the event or the capture phase
  3. Google and Firefox do not support the object .attachEvent ( "on" + event type, event handler)

Unbundling event elements:

  1. Object .on event type = null;
  2. IE8 does not support object .removeEventListener (not on the event type, event handler, false);
  3. Google Firefox does not support object .detachEvent ( "on" + event type, event handler);

Event bubbling : when there is a nested relationship of elements, and each element contain the event, when the event triggering the inner, outer events will be triggered.

Stop the event bubbling way :

  1.   window.event.cancelBubble = true; Firefox does not support
  2.   e.stopPropagation (); e is the event parameter object does not support ie8

Guess you like

Origin www.cnblogs.com/liualexsone/p/11355459.html