How to prevent the influence of the CHILD element on the PARENT element?
JQuery
$("#parent").click(function() { alert('parent clicked'); }); $("#child").click(function() { alert('child clicked'); });
HTML:
<div id="parent"> click me - parent <div id="child">click me - child</div> </div>
If you click on a child, the parent is also activated, and we have 2 warnings.
So, how can I prevent a child from influencing a parent?
David source share