change html content back and forth

change html content back and forth

Hello

I used the jquery-function replaceWith() to replace this html part <div class="montag">...</div>
with this part <div id="ersatz">...</div>

Then i implemented a listener for montag and a listener for ersatz, so I can switch back and forth between
the different parts.

The side gets loaded within the montag div and when i click on this part the listener works and the html
gets switched to the ersatz part, but after this the listener for ersatz does not work, although the modified html gets displayed
in firebug.

Are there any solutions for such a kind of problem?

Regards,
Michael