Follow

TIL that when referencing a DOM element that triggered an eventListener, you probably want event.currentTarget over event.target

currentTarget always references the element that has the eventListener attached, where as target can be a child element of the currentTarget.

developer.mozilla.org/en-US/do

via baldurbjarnason.com/2021/five-

@edwardloveall I had seen this in autocomplete. Nice to know it isn't fake news from CoC. :P

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!