JavaScript how to log the value a user has put in? [closed]

The problem given was:

When the user clicks the button with the ID of generate-message, log the value the user has typed into the input field.

Here is the HTML provided:

 <input type="text" id="message">
 <button id="generate-message">Express Yourself!</button>

I have tried multiple things, my most recent attempt was:

 const button = document.getElementId("generate-message")
 button.addEventListener("click", function(){
 })