Code:
<script language="javascript">
function xyz(){
var ch = document.frm.char.value;
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'){
document.getElementById('rst').innerHTML = "Character is Vowel";
}
else{
document.getElementById('rst').innerHTML = "Character is Consonent";
}
}
</script>
<div id="rst"></div>
<form name="frm">
<label>Enter Character</label>
<input type="text" name="char" />
<br />
<input type="button" value="Submit" onClick="xyz()" />
</form>
Comments
Post a Comment