I am working on a project where I would like to add many elements of the same class to the page and make all these classes available to $ ('selector'). click (); event handler. However, it happens that not one of the dynamically added elements of the same class responds to clicks.
To give you a better idea of ββwhat I mean, I compiled a jsFiddle sample, which is very similar to the real problem in my project:
Link to jsFiddle: http://jsfiddle.net/8LATf/3/
One element of the class "added_element" is on the page already at loading. This item can be clicked.
A button is pressed and it adds other elements of the "added_element" class to the page dynamically using append. None of these items are clickable.
How can I make all elements of the "added_element" class clickable? I assume this is due to the selector that I use in the event handler, but I could not understand it.
Any help is much appreciated !!!
source share