This might be a dumb mistake but I have this code:
$('#delete-btn').on('click', function(){
return confirm('Are you sure you want to delete this?');
});
the alert does not occur but with this code it does:
$(document).on('click', '#delete-btn', function(){
return confirm('Are you sure you want to delete this?');
});
from what I understand they are the same thing, but the second tries to process the event every click on the page looking for the specified id. I tried putting it in a document ready block but that didn't help.
I don't understand why one works and the other does not.