I set the event in a wrapper div , but inside this div I have buttons , how can I prevent the wrapper event in buttons ?
HTML
<div class="wrapper-alert"> <div class="somethingElse"> Some text </div> <div class="this-is-my-action"> <button class="inside-alert">Inside</button> </div> <div class="somethingElseTo"> Some text </div> </div>
I made jsfiddle to be more clear.
so basically, if I click on wrapper-alert , some message will appear, but if I click on button , another thing will happen, the problem is that the buttons are children from the wrapper, so 2 events will immediately fire.
I will try something with if (e.target !== this) return; , but only works with one children or some basic structure.
source share