跳到主要内容

事件委托

原理: 利用冒泡的原理,把事件加到父级上,触发执行效果。减少过多添加事件性能好;针对新创建的元素,直接可以拥有事件;

示例页面

  • this 1
  • this 2
  • this 3
  • this 4