how to validate if text input has only alphabets js code example Example: how to check if a string has only alphabets in javascript if (!/[^a-zA-Z]/.test(word))