Issue applying click actions to jQuery-created elements

Issue applying click actions to jQuery-created elements

I have been having issues with the .html(), .append() and .prepend() functions. If I attempt the following code ...

  1. $('div').append('span id="clickme">click me</span>');

... then try to run the following function ...

  1. $('#clickme').click(function() { /* do something here */ });

... jQuery doesn't seem to register the click. Is this a known bug? Is there a way around this?