JavaScript JS program to find a total number of vowels in a string flowchart with form values entered by the user.

JavaScript JS program to find a total number of vowels in a string flowchart with form values entered by the user.

In this tutorial, we will learn about the followings.

  1. Flowchart of JavaScript JS program to find a total number of vowels.
  2. JavaScript JS program to find a total number of vowels in a string.
  3. JavaScript JS program to find a total number of vowels in a string with form values entered by the user.

Flowchart of JavaScript JS program to find a total number of vowels.

JavaScript JS program to find total number of vowels in a string flowchart with form values entered by user.
Figure: JavaScript JS program to find a total number of vowels in a string flowchart with form values entered by the user.

JavaScript JS program to find a total number of vowels in a string.

<html>
<head>

<script >
function Vowels() {
var str = "I love t4tutorials.com";
var count = 0, total_vowels="";
for (var i = 0; i < str.length; i++) {
if (str.charAt(i).match(/[a-zA-Z]/) != null) {


if (str.charAt(i).match(/[aeiouAEIOU]/))
{
total_vowels = total_vowels + str.charAt(i);
count++;
}
}
}
document.getElementById('vowels').value = total_vowels;
document.getElementById('vcount').value = count;
}
</script>
</head>
<body>

<tr>
<td>Enter Text :</td
<td><input type='text' id='textname' value="I love t4tutorials.com"/></td> 

Total Vowels :
<input type='text' readonly="readonly" id='vowels' />

Count Vowels:
<input type='text' readonly="readonly" id='vcount'/>


<input type='button' value='Get Vowels Count' onclick="javascript:Vowels();" />


</body>
</html>



JavaScript JS program to find a total number of vowels in a string with form values entered by the user.

<html>
<head>

<script >
function Vowels() {
var str = document.getElementById('textname').value;
var count = 0, total_vowels="";



for (var i = 0; i < str.length; i++) {
if (str.charAt(i).match(/[a-zA-Z]/) != null) {


if (str.charAt(i).match(/[aeiouAEIOU]/))
{
total_vowels = total_vowels + str.charAt(i);
count++;
}
}
}
document.getElementById('vowels').value = total_vowels;
document.getElementById('vcount').value = count;
}
</script>
</head>
<body>

<tr>
<td>Enter Text :</td
<td><input type='text' id='textname'/></td> 

Total Vowels :
<input type='text' readonly="readonly" id='vowels' />

Count Vowels:
<input type='text' readonly="readonly" id='vcount'/>


<input type='button' value='Get Vowels Count' onclick="javascript:Vowels();" />


</body>
</html>



Topic Covered:

JavaScript JS program to find a total number of vowels in a string flowchart with form values entered by the user.
 
List of All Programs of Javascript : Click Here 
.

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.