When you set any properties/bind events in your $(document).ready(function() { ... }) they are executed on page load. So it is all applied to the DOM elements that are present initially.
But when you call the AJAX request and insert some elements into your document, the jquery statements are not executed again (because document.ready doesn't fire). Some solutions to overcome this are:
- execute the inside of the document.ready function or the relevant part of it after you insert the new elements.
- if the only thing you need are event handlers that should be bound the the new elements you may use live events.