Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save awestmoreland/4ae7a6077f35a6d5c5b3d23a733baa24 to your computer and use it in GitHub Desktop.
Save awestmoreland/4ae7a6077f35a6d5c5b3d23a733baa24 to your computer and use it in GitHub Desktop.
// Only works for existing button.remove elements
$('#broken button.remove').on('click', function(){
$(this).remove();
});
// Works for existing button.remove elements, and new ones added dynamically
$('#working').on('click', 'button.remove', function(){
$(this).remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment