相关疑难解决方法(0)

如何使用内联onclick属性停止事件传播?

考虑以下:

<div onclick="alert('you clicked the header')" class="header">
  <span onclick="alert('you clicked inside the header');">something inside the header</span>
</div>
Run Code Online (Sandbox Code Playgroud)

如何才能使用户点击跨度时,它不会触发div点击事件?

html javascript events dom

297
推荐指数
10
解决办法
42万
查看次数

标签 统计

dom ×1

events ×1

html ×1

javascript ×1