A very simple situation:
<div class="item">
<div class="text">test</div>
</div>
And the javascript:
var item = document.querySelector('.item');
item.addEventListener('click', function(e){
console.log(e.target);
})
I cannot seem to understand, why, if I have bound the event to the item, the event target shows up as the child and not the element I have originally bound it to?
I apologise if this is duplicate, I sincerely looked for similar question and answer beforehand, but did not find anything that would explain this.
Thanks.