Find vowels in your string using JS
This website only made for study don't disturb please
Share this link
HTML51010.blogspot.com
Code
<html>
<head>
<style type="text/css">
input[type="text"] {
color:#fff;
font-size:1.2em;
background:#000;
height:40px;
width:80%;
margin-top:100px;
border:2px solid #000;
}
input[type="button"]{
background:skyblue;
height:40px;
width:150px;
}
input[type="button"]:hover{
background:linear-gradient(skyblue,lime);
}
input[type="button"]:hover{
height:40px;
width:150px;
border-radius:50px;
}
</style>
<script type="text/javascript">
function display(){
var string =form.input.value;
let count =0;
let vowel = ["a", "A", "E", "e", "i", "I", "o", "O", "u", "U"];
for (let i = 0; i < string.length; i++) {
if (vowel.includes(string.charAt(i))) {
count++;
}
}
document.write("vowels in your string is "+count);
}
</script>
<body><center>
<form name="form" >
<input type="text" name="input" ><br><br><br><br><br>
<input type="button" value="check plese" onclick="display()" >
</form></center>
Comments