这是我的HTML的摘录:
<section id="order">
<div id="warenkorb-button" class="warenkorb-bg-color"><a id="wk-btn-a" href="#warenkorb">zum Warenkorb hinzufügen</a></div>
</section>
那是我的JavaScript:
$(function() {
$(document).on('click', '#warenkorb-button a', function(xyz){
alert('test');
xyz.stopImmediatePropagation();
});
});
这不起作用/解雇 - 如果我重写它就像它正在工作:
$(function() {
$('#warenkorb-button a').on('click', function(xyz){
alert('test');
xyz.stopImmediatePropagation();
});
});