html
html
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<head>
<title>Vowel Counter</title>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var aString = prompt("Write a statement or word to count the vowels.");
var vowels = "aeiou";
var result = 0;
document.write("<h1 align='center'>Vowel Counter</h1>");
for(var count = 0; count < aString.length; count++) {
for(var i = 0; i < vowels.length; i++) {
if(aString.charAt(count) === vowels.charAt(i)) {
result++ ;
}
}
}
document.write("<h2>Number of Vowels in your statement >> </h2>" + result + "<hr />");
document.write("<h2>Your Statement is :</h2><br />" + aString);
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run