event.keyCode === 27 code example Example: event.keyCode === 13 It's the [Return] or [Enter] key on keyboard.