I have a div inside another div. When I am clicking on inner div I am getting that inner div as target. And when I am clicking on outer div I am getting that outer div as target. So how I get inner div by clicking on inner and outer div (both) without assign different events to both divs?
Asked
Active
Viewed 92 times
0
-
Does this answer your question? [What is event bubbling and capturing?](https://stackoverflow.com/questions/4616694/what-is-event-bubbling-and-capturing) – tevemadar Nov 02 '20 at 08:33
-
1on a fetched click event on an element, in the target object is the element under the mouse. So you can't have the same routine for both elements, unless you handle both differently in one – Scriptkiddy1337 Nov 02 '20 at 08:44
-
no @tevemadar. But thanks for this useful answer. – MdFarzan Nov 02 '20 at 09:39