[jQuery] event question

[jQuery] event question


I have a click even that I add to a certain class when the page is
created. There is the possibility of dynamically adding another
element with that class, and I would like to have the same click even
added. I'm just wondering what would happen if I registered the click
event for that class, would that work? For instance:
At page creation, this is run:
$('.classname').click(function() {
...
});
If I ran this after a new element with that class was created, would
that screw anything up. I do have an id associated with the element,
so I could just add the event that way. I just wasn't sure if there
might be a better way, or if I could add that to a function, and just
call it when needed.