Write a Jquery program to check input alphabets vowel or not ?




Check you entered alphabet is Vowels or Consonants ?



<!DOCTYPE html>

<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" type="text/css" href="style.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>

  <script type="text/javascript">

$(document).ready(function(){

$("#btn").click(function(){

var ch = $("#split").val();


if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch =='o' || ch=='O' || ch == 'u' || ch == 'U')

{

$("#demo").html("You Enter alphabet is Vowel");
}
else
{

$("#demo").html("You Enter alphabet is not Vowel");
}
});


});


</script>
</head>

<body>

<div>
<h2>Check vowel or not?</h2>
<input type = "text" id = "split" placeholder="Enter alphabet" >

<p id="demo"></p>

<button type = "button" id = "btn">Check</button>
</div>
</body>
</html>



Comments

Popular posts from this blog

how to customize dashboard in active admin gem in rails 4

fibonacci series in Ruby

Simple calculator using JQuery and HTML..