我的問題是如何區分一個點擊的錨點和點擊div其中這個錨點是在一個div。jquery點擊錨內部div區分兩者
<div class='box'>Message goes here and this is my anchor <a href="#"> my link</a></div>
<div class='output'></div>
$(".box").click(function(){
$('.output').append('box clicked!');
});
$(".box > a").click(function(){
$('.output').append('anchor clicked!');
});
所以,我想要「錨點擊」沒有「框點擊」。這可能嗎? 看看這jsfiddle瞭解我的疑問:JSFiddle
您需要在錨單擊處理 – billyonecan