1

How can i get event path in ie?

For example we have the next code:

document.addEventListener("click", event => {
  console.log(event.path);
  // In chrome => [element,...]
  // In IE => undefined
})

How can I get event path in IE?

mplungjan
  • 155,085
  • 27
  • 166
  • 222
tetra master
  • 467
  • 7
  • 13

1 Answers1

1

The path is a non standard feature which may not have wide support especially in older browsers / ie browsers

  • Is there another methods to do this? – tetra master Jan 24 '19 at 10:14
  • Not that easy. I would rather concentrate on modern browsers. –  Jan 24 '19 at 10:28
  • Event.path is not supported by MS Edge and IE. You can verify this from this link. https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath I did not get any other way to get event.path for IE. – Deepak-MSFT Jan 25 '19 at 07:03