JavaScript : - Switch Case.


Hello Friends..!!

This is JavaScript Practical: - Switch Case.
Script written in small letter because JavaScript Case Sensitive.

Script:-
<html>
<head>
<title>switch</title>
</head>
<body>
<script type="text/javascript">
// this is a switch case
var grade='1';
document.write("enter grade situation<br /><br />");
switch(grade)
{
case'1':document.write("A<br />");
break;
case'2':document.write("B<br />");
break;
case'3':document.write("C<br />");
break;
case'4':document.write("D<br />");
break;
default:document.write("E<br />");
}
document.write("this is your grade");
</script>
</body>
</html>
Save the File .html

Output:-


If you have any doubts mention on the Comment Box.

Please follow my Blog, Share and Comment.

Comments

Popular posts from this blog

What is Website