Problem:
I'm interested to bind the click event of all children of a dynamically generated div.
Understandings:
Binding as of 1.7
$(staticAncestors).on(eventName, dynamicChild, function() {...
example:
$('body').on('click','.myDiv', function() {...
Using * as selector binds to ALL ELEMENTS
$('.myDiv').on('click', '*', function() {...
Question:
How would I bind the * to a dynamically generated div?
've replicated my project in a jsfiddle.
NOTE: In Ahmad's jsfiddle (see the first answer), the child click events work WITH or WITHOUT the *
included in the on click selector. In my jsfiddle, my example works fine (when the *
isn) if you click the PARENT div, but clicking on CHILD elements (image and text title) does not. Now, add the * to my example, and nothing works...