content icon indicating copy to clipboard operation
content copied to clipboard

Comparison of Event Targets

Open kh1925 opened this issue 1 year ago • 2 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Event/Comparison_of_Event_Targets

What specific section or headline is this issue about?

the first table on the page

What information was incorrect, unhelpful, or incomplete?

I think there is a mistake. the purpose of event.target and event.currentTarget are switched.

What did you expect to see?

in the table, the purpose of 'event.target' and 'event.currentTarget' should be switched.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
  • Folder: en-us/web/api/event/comparison_of_event_targets
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/Event/Comparison_of_Event_Targets
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/event/comparison_of_event_targets/index.md
  • Last commit: https://github.com/mdn/content/commit/88241bf466f1025d3c2f4ce2752586dd85d1ae13
  • Document last modified: 2023-11-02T21:05:11.000Z

kh1925 avatar Feb 10 '24 11:02 kh1925

No, I think the text is correct.

skyclouds2001 avatar Feb 11 '24 14:02 skyclouds2001

But the documentation, https://developer.mozilla.org/en-US/docs/Web/API/Event/Comparison_of_Event_Targets, can be updated as a section in Event's documentaion

And the link of the specifications need to update, too.

skyclouds2001 avatar Feb 11 '24 14:02 skyclouds2001

The current description is correct. target is what the event is fired on and currentTarget is what the listener is attached to. In the eyes of the listener, target may change but currentTarget is always the same; in the eyes of an event that gets passed to many listeneers, target is the same but currentTarget changes.

@skyclouds2001 Agreed but that would be a separate issue (and we also have an entire events reference that probably should be moved)

Josh-Cena avatar Jun 05 '24 08:06 Josh-Cena