这是HTML:
<ul>
<li>This should fire</li>
<li>This should not fire, but does <div class="delete">Delete</div></li>
<li class="load">This does not fire as expected</li>
</ul>
这是 jQuery
$('ul').on('click', 'li:not(.load):not(:has(.delete))', function() {
alert('fire');
});
知道当 li 有一个带有 class 的子元素时如何防止 jQuery 触发.delete
吗?