Both will be executed; one does not overwrite the other. They are used in different contexts but can work together at the same time.
When you click the button, you’ll see in the console:
onclick listener