我有以下代码:
<a id="clickme" href="#">
<span>Text for link goes here</span>
<button id="deleteme">X</div>
</a>
以下javascript:
$("body").on('click', "#clickme", function(e) {
//stuff here
});
$("body").on('click', "#deleteme", function(e) {
//stuff here
});
如何点击#deleteme
#clickme
的点击事件未运行?
答案 0 :(得分:3)
$("body").on('click', "#deleteme", function(e) {
e.stopPropagation();
});