DOM0 level and DOM2 level difference

 1, DOM0 level and common advantage DOM2 class:

can add multiple event handlers are executed in sequence, HTML event handler can not be done ~

2, on the difference between dom0 and dom2 grade level

DOM0 level event handler: simultaneous binding of several different events, such as onclick on the basis of the binding and then bind to a onmouseover button 2 to set the background color (here, be careful not to onclick, onmouseover events are set to alert pop-oh, there may be conflict, dom0 and dom2 can not succeed) ; but not both bind the same plurality of event, such as the onclick; overwrites, only the last function performed;

the DOM2 event processing stage: advantages: bind several events simultaneously (same or different), then execution order, It will be covered. Disadvantages: cross-browser does not have the advantage.

In addition, IE9 compatible dom2

Guess you like

Origin www.cnblogs.com/hy96/p/11433063.html