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