Default behaviour of the Enter key in a textarea is to add a new line. To prevent this action occurring within the createOnEnter method, add e.preventDefault(); after matching the key press as the Enter key.