<!DOCTYPE html> <html> <head> <title>Switch Statement Demo-aimtocode</title> <script type="text/javascript"> var grade='A'; switch(grade) { case'A': document.write("School: aimtocode.com<br/>") document.write("Std Name: Prayag<br/>") document.write("Result: Distinction<br/>"); break; case'B': document.write("School: aimtocode.com<br/>") document.write("Std Name: Mugu<br/>") document.write("Result: First Class<br/>"); break; case'C': document.write("School: aimtocode.com<br/>") document.write("Std Name: Rakesh<br/>") document.write("Result: Second Class<br/>"); break; case'F': document.write("School: aimtocode.com<br/>") document.write("Std Name: Hazra<br/>") document.write("Result: Failed<br/>"); break; default: document.write("School: aimtocode.com<br/>") document.write("Std Name: Pankaj<br/>") document.write("Did not appear for exams<br/>") document.write("Result: Did not appear for exams<br/>") } </script> </head> <body> </body> </html>