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 ...
- $('div').append('span id="clickme">click me</span>');
... then try to run the following function ...
- $('#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?