The addEventListener() and onclick both listen for an event. Both can execute a callback function when a button is clicked.