user276289 user276289 - 6 months ago 22
Javascript Question

jQuery event is triggered twice

I have the following problem with this code:

<button id="delete">Remove items</button>

icons: {
primary: 'ui-icon-trash'
}).click(function() {

If I click this button, the alert show up two times. It's not only with this specific button but with every single button I create.

What am I doing wrong?


Your current code works, you can try it here:

You have something outside the example triggering another .click(), check for other handlers that are also triggering a click event on that element.