I have this jQuery code:
$("div.note a").live("click", function(e) {
e.preventDefault();
alert('test');
});
<div id="note_list">
<div class="note">
Text 1
<a href="">X</a>
</div>
<div class="note">
Text 2
<a href="">X</a>
</div>
<div class="note">
Text 3
<a href="">X</a>
</div>
</div>
Could someone tell me why the alert shows 3 times? It works fine in Chrome but not in Firefox.
It is called onetime, in your case you can stop multiple event call by
e.stopImmediatePropagation();