重点记忆

不要混淆 e.stopPropagation()e.preventDefault()。它们都很有用,但二者并不相关:

  • e.stopPropagation() 阻止触发绑定在外层标签上的事件处理函数。
  • e.preventDefault() 阻止少数事件的默认浏览器行为。