When you do something like
jquery inspects the current dom, and finds all elements which exist at that specific moment in time, that have that classname. It tells each of those existing elements to run your function if they get clicked.
If you later create new elements, it doesn't matter whether or not these new elements have been given the same classname. They simply don't know they should do something when clicked.
You can either tell the new elements after you create them, or, you can read up on jquerys live() method, which does some behind the scenes magic, using event delegation, so that all present, and future elements which match your selector, will run your function for the event.