Problem: Many times it is found that binding the Click event to a dynamically generated element is not valid ~
Cause: Binding directly to dynamically generated elements is not valid because jquery scans the document to find all the $ (') elements and binds the function to the click event of each element, indicating that there are elements that exist on the existing page and that the dynamically generated elements are not included .
Workaround: The agent or delegate on (), the implementation principle is the bubbling of events, in the specified ancestor element register event, element event trigger, propagate to this element and then filter.
Events can be bound in ancestor elements, such as a div is an ancestor element, and the newly generated element is a child of the Div, so events of dynamically generated elements can be bound.
$ (". Parents"). On ("click", ". Children",function() { //})// the binding ancestor element. Parents delegate to his child element, which is the element you really want to bind ~ ~
jquery has an invalid problem with dynamically generated element bindings ~ ~