Solution:
<html>
<head>
<script>
function PQR()
{
var str = document.getElementById('a').value;
var count = 0;
for (var i = 0; i < str.length; i++)
{
if (str.charAt(i).match(/[aeiouAEIOU]/))
{
count++;
}
}
alert(count);
}
</script>
</head>
<body>
Enter Text : <input id='a'> </br></br>
<button onclick="PQR()">click</button>
</body>
</html>
0 Comments