<div id="firstDiv" style="width:1000px;height:600px;">
<div id="secondDiv" style="width:200px;height:200px;"></div>
</div>
这两个DIV都有click()事件。当我点击secondDiv时,firstDiv的点击事件也被触发(我猜这是逻辑,因为我也在firstDiv的边框内点击了)。然而,我只想触发DIV的点击事件,点击时我实际上已经将鼠标移到了上面。如何点击()只点击DIV,不包含DIV?
我该如何做到这一点?
重复http://stackoverflow.com/questions/2015041/two-differents-onclick-on-two-divs-one-over-the-other – Mandar 2013-04-23 20:35:35
[click - only on“direct”onclicks]( http://stackoverflow.com/questions/6512803/click-only-on-direct-onclicks) – Nope 2013-04-24 17:18:51
['event.stopPropagation'](http://api.jquery.com/event.stopPropagation/)? – 2013-04-24 19:29:00