0% found this document useful (0 votes)
18 views3 pages

Practical - 7

Uploaded by

rsmuiscool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Practical - 7

Uploaded by

rsmuiscool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Shri Pramod Patil (SPPAC) Junior College

Name : PATHADE MEDHAVI MAHESH


Std : 12th Div : A
Roll No : 12118
Practical No : 7 Date :
Practical Name : To accept string from user and count number of vowels in the
given string.

Code for vowel.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vowel</title>
</head>
<body>
<form name="form1">
<h1>Enter the string whose vowel is to be counted</h1>
<input type="text" name="text1">
<input type="button" name="btn_checkvowel" value="Click to count"
onclick="count()">
</form>
<script type="text/javascript">
function count()
{
var i,ch,str,counter=0;
str=form1.text1.value;
for(i=0;i<str.length;i++)
{
ch=str.charAt(i);
if(ch=='A' || ch=='a' || ch=='e' || ch=='E' || ch=='i' || ch=='I' || ch=='o' || ch=='O' ||
ch=='u' || ch=='U')
counter++;
}
alert("Number of vowels in Entered String is:"+counter);
}
</script>
</body>
</html>
Output

You might also like