A function is triggered when the user presses a key in the input field. The function alerts the key pressed.