While I am still relatively new to JavaScript and learning, I have developed a webpage with multiple buttons that trigger different functions on click events. However, I would like to additionally call another function when any of these buttons are clicked, without interfering with their normal functionality. These common functions adjust the height of the parent div based on the specific function triggered by the button.
I could simply include my common function within each individual button's function, but I am curious if there is a different way to call this additional function when clicking any button inside the specific div without manually adding it to each button's onclick event. Alternatively, is there a method to add an event listener to all child buttons within the div at once?
This must be achieved using only pure JavaScript