Switch based on integer value
<HTML> <BODY> <H1> <SCRIPT> var n = 1; switch (n) { case 1: { document.write("n equals 1"); break; } case 2:{ document.write("n equals 2"); break; } case 3:{ document.write("n equals 3"); break; } default:{ document.write("No match!"); break; } } </SCRIPT> </H1> </BODY> </HTML>