Page 425 - Webapplication11_C11_Flipbook
P. 425

}
                        else
                        {
                               document.write("Try again..............");
                        }
                      </script>
                      </body>
                      </html>
                      On running the above program, we get the following output:















































                   24.  Write the program to select the subject by user using switch statement

                  Ans.  <!DOCTYPE html>
                      <html>
                      <head>
                          <title> Switch Statement </title>
                      </head>
                      <body>
                      <script>
                        var choice = parseInt(prompt("Please select the Subject: Enter 1 for Hindi
                      / 2 for English"));
                        switch(choice)
                        {

                                                                                                     Practical Work  423
   420   421   422   423   424   425   426   427   428   429   430