Page 368 - Webapplication11_C11_Flipbook
P. 368

</SCRIPT>
                 </BODY>

                 </HTML>
              On running the above program, we get the following output:























              When you click on the “OK” button, with the message “This page says”. Then a new window appears as shown below:















              Example:

                 <HTML>
                 <BODY>
                 <SCRIPT>

                 var fav_food = prompt("Enter Your favourite food");
                 document.write("Favourite Food Entered:"+fav_food+"<br> <br>");
                 switch (fav_food) {
                     case "pizza": document.write("Pizza is 350 rupees<br>");

                                   break;
                     case "pasta": document.write("Pasta is 80 rupees<br>");
                                   break;
                     case "chowmein": document.write("Chowmein is 100 rupees<br>");

                                      break;
                     default:  document.write("Any other food is not available")
                             }
                 </SCRIPT>
                 </BODY>

                 </HTML>
                366     Touchpad Web Applications-XI
   363   364   365   366   367   368   369   370   371   372   373