Jquery On Click Event Firing Multiple Times
I just learned how to use the method .on() and I use it to add an event handler to some buttons that are added 'live' (after the DOM is ready). $('#table').on('click', '.delete',
Solution 1:
just add off() before on() to remove existing event on it
there's a possibility that you already bind an event in that element so if you want to rebind the event you just off('event') to avoid firing event multiple times
$('#table').off("click").on("click", ".delete", function() {
var data_name = $("#dataSelector option:selected").attr('name');
alert(data_name);
});
Post a Comment for "Jquery On Click Event Firing Multiple Times"