html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!--Created by Vitaliy Angelov for Chalenge: Vowel Counter-->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Challenge: Vowel Counter</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
/*Created by Vitaliy Angelov for Chalenge: Vowel Counter*/
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
17
18
19
20
21
22
23
24
25
26
/*Created by Vitaliy Angelov for Chalenge: Vowel Counter*/
$(function() {
alert("You can type all that you want and you can cancel too!")
var arr;
func();
function func() {
arr = prompt("Type the string, please!");
if (arr == false) {
alert("You did not type the string!");
func();
} else if(arr == null) {
alert("Sorry, but you canceled. Thank you for your upvote!");
} else {
arr = arr.toLowerCase().split("");
var arrFinish = [];
for(i = 0; i<arr.length; i++) {
if (arr[i] == "a" || arr[i] == "e" || arr[i] == "i" || arr[i] == "o" || arr[i] == "u" || arr[i] == "y") {
arrFinish.push(arr[i]);
}
}
alert("The string you entered: " + arr.join("") + " .There are " +arrFinish.length+ " vowels in your string!");
alert("Please, don't forget to upvote the code if you liked it! Thank you!!!");
}
}
});
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run