Let's say you add an element to the DOM via jQuery:
$("<button class="delete">Delete</button>").appendTo("foo");
And want to later remove it via a jQuery event. Calling $('.delete').on('click')
will not fire the event. This is because .on() only looks for elements that were loaded initially with the DOM. To resolve …