我有一個簡單的HTML,其中包含了一些HTML和刪除鏈接一個div:jQuery忽略父項?
<div class="item">
I am a text this section can contain a lot of html and stuff...
<a class="del_button" href="#">Delete</a>
</div>
這裏是jQuery的部分:
$(".item").click(function(){
alert("Item clicked");
});
$(".del_button").click(function(){
alert("DELETE clicked");
});
如果我點擊「刪除」鏈接,二顯示消息框,「點擊項目」和「刪除點擊」 - 如果我點擊刪除按鈕,如何禁用「項目點擊」警報?
可能重複http://stackoverflow.com/questions/2364629/jquery-stop-child檢查 - 觸發 - 父母事件) – Matt