Skip to content
Advertisement

Extracting the id of an element from Event Listener e.path Array?

I’m trying to get my head around Event’s and I’m totally lost? I would like to access an elements id from an event listener, using e.path Array? The id that I want is always in the article id=”someID” node of the objTmp Array().

I also can figure out why this only works in Chrome all other browsers say that objTmp is undefined?

Any help would be appreciated…

JavaScript

Advertisement

Answer

Here’s a way to locate the ancestor ARTICLE node without using event.path:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement