3 ms·
> Event handler properties have disadvantages compared to addEventListener(). One of the most significant is that you can't add more than one listener for a sin
by amadeuspagel 1y ago
> Event handler properties have disadvantages compared to addEventListener(). One of the most significant is that you can't add more than one listener for a single event. The following pattern doesn't work, because any subsequent attempts to set the property value will overwrite earlier ones:
That's not really a disadvantage, rather it makes it easy to change the event handler.
- lionelw 1y agoWhen is it ever necessary to change event handlers?