Check out this FAQ entry: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F
Karl Rudd On Fri, Apr 25, 2008 at 7:50 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hey, Here's an outline of what I'm trying to accomplish: > > 1) Clone one div into another...maintaining events (works) > 2) Append that html into a div (works) > 3) Run a search and replace on the new contents (works) > 4) Keep the events (doesn't work) > > Here's the code i'm using: > > $('.codex-relational-anchor').bind('click',function(){ > > //If the button is clicked for the first time, clear > the divs contents > if(iter == 0) > $('.codex-relational- > form').slideUp('fast').empty(); > > //Clone the contents of .manytomany-hidden along with > their events into .codex-relational-form > $('.manytomany-hidden .relational-form- > extra').clone(true).appendTo(".codex-relational- > form").parent().slideDown('fast'); > > > var html = $('.codex-relational-form').html(); > html = html.replace(/\{num\}/g,iter); > $('.codex-relational-form').html(html); > iter++; > > return false; > }); > > If I comment out the string replacements, then the events remain. >