当单击子锚时,如何防止父级单击事件触发?
JavaScript
var url = $("#clickable a").attr("href");$("#clickable").click(function() { window.location = url; return true;})
HTML
<div id="clickable"> <!-- Other content. --> <a href="http://foo.com">I don't want #clickable to handle this click event.</a></div>
翻过高山走不出你
杨__羊羊
慕雪6442864
相关分类