📜  事件委托 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:35.135000             🧑  作者: Mango

代码示例1
Explain event delegation :

“Js event listeners fire not only on a  single DOM element 
but on all its descendents”

The idea is that if we have a lot of elements handled in a 
similar way, then instead of assigning a handler to each of 
them – we put a single handler on their common ancestor.