var letra = prompt("Digite uma letra:");
//passando variável para minúscula
letra = letra.toLowerCase();
//checando vogais
if(letra == "a" || letra == "e" || letra == "i" || letra == "o" || letra == "u"){
document.write(letra + " é uma vogal");
}
else{
document.write(letra + " é uma consoante!");
}
Only I found two problems
1. Check if it's number
For example, if the user types: 4 the result is: 4 is a consonant!
For program 4 it is not a vowel, so it is consonant, so I want to check if the string is a 'number' and print to the user who is to type only letters
2. Check if other characters are ex; #% *
For example, if the user types: # the result is: # is a consonant
So I want to check if the string is a special character and if it is, print it for typing only letters
* I want to create two else if in the program to check if the string is a number and if the string is a special character
* I'm learning JavaScript and it's an exercise with if / else so if possible I want a solution with pure JavaScript (without Jquery if possible)