You are looking for live . In the manual:
Binds a handler to an event (for example, a click) for all elements corresponding to the current and future. May also bind custom events.
So if you do this:
$(document).ready(function() {
$('div.test').live('click', function() { alert('yipee!'); });
$('body').append('<div class="test">Click me!</div>');
});
When you click on a div, you will get a warning even if it was added after the event was connected.