【发布时间】:2014-11-17 05:29:34
【问题描述】:
描述:
我有以下 HTML
<a href = "go some where">
<div onclick = "myfunc1(....)">CLICK ME A</div>
<div onclick = "myfunc2(....)">CLICK ME B</div>
</a>
现在,当我单击第一个 div 时,锚标记会被触发,第二个 div 也是如此。我希望能够单击锚标记内的任何 div,它应该只调用分配给它的函数 ...
当且仅当我不点击任何 div 但整个其他区域锚标记具有然后它应该带我到页面 href 有...
我尝试了什么:
$(".add_this_person").on("click", "a", function (e) {
e.preventDefault();
} ); // where add_this_person is a class of both divs
【问题讨论】:
标签: javascript jquery