Dear experts,
I realized event.target redundancy could cause a lot of problems in the future when they are binded with another event in the next level.
For example, when i have an Div element inside another.
<div id='div1'>
<div id='div2>
</div>
</div>
I use the follow Jquery code to bind an event.
$('div').bind('click', function(event){
alert(event.target.id)
}
There are two alert boxes instead of one. I understand the concept of why is because there are 2 divs I am clicking.
Of course the problem in a deeper level is that when I am trying to bind an event after this event accordingly with the event.target, it binds x2 so on and so forth.
Is it possible to get rid of the event binding on the outside div and only capture the inside.
Thanks in advance.