I have a nested html structure that needs to change in a certain way when clicked. For that, i need the element that the event is bound to, not the element that is clicked
For example....
theDesiredElement.addEventListener('click', function() { ... i need 'theDesiredElement' here } , false); Getting event.target get's the clicked element, not the element that the event is bound to. Is there a way to do that?
thisorevent.targetwill be the element that the event occurred in and the event handler is attached to.thisjsfiddle.net/zLLyS