Adding Event Listeners
Use theaddEventListener() method to register event listeners. The method returns an unsubscribe function that you should call to remove the listener when no longer needed.
addEventListener() method to register event listeners. The method returns an unsubscribe function that you should call to remove the listener when no longer needed.