Try something like
$("#container").on('click', 'someLinkSelector', function(){ $("#container").html( <new html with new spans> ) });
You basically need to attach your events from a non-dynamic part of the DOM so it can watch for dynamically-created elements.