<div onClick={()=>do_stuff()}>
<div classname="div-1"></div>
<div classname="div-2"></div>
<div classname="div-3"></div>
<div classname="div-4"></div>
<div classname="div-5"></div>
</div>
When you click on the parent element, it will trigger a function called do_stuff()
, but this should only happen if the click did not target elements with class names like div-4
or div-5
.
If you are using React, how would you implement this functionality?