What is the difference between DOM Level 0 events vs DOM Level 2 events?

后端 未结 2 1336
遇见更好的自我
遇见更好的自我 2020-12-15 12:28

What is the difference between DOM Level 0 events vs DOM Level 2 events? I ask because I was told that Firefox and IE call them in a different order and I had never heard th

2条回答
  •  -上瘾入骨i
    2020-12-15 12:55

    In addition to the issue that previous answer mentioned completely and correctly, which concentrated on the type of using event handlers to call functions or to perform some other JavaScript(I mean using inline registration model and traditional registration model vs using addEventListener(...), removeEventListener(...), or dispatchEvent(...) ) and also to add additional information to this duplicated question, there is another great difference between DOM Level 0 vs DOM Level 2 event model.

    Through DOM Level 2 event model, it is simply possible that a specific object(for example via: document.getElementById("elementId")), with a specific event(one of click or load, ...) can be registered any number of event-handler functions. For example:

    
    
        
            
            
    
        
    
    

    This was one of the problems in DOM Level 0, which is handled via other solutions.

提交回复
热议问题