Imagine the following use case:
A page contains a multitude of buttons, each of them triggers different functions. The examples what I saw added event listeners to every button.
However what will happen if I add an event listener to the whole document, then extract the given element from the point, so I know what was clicked, and call a function accordingly.
In that case there is only one event listener, and not as many as number of the buttons.
Will this method give me performance gain?