Page 355 - Webapplication11_C11_Flipbook
P. 355

<script type="text/javascript">
                   var answer=confirm("Do you want to cancel your Aadhaar Application?");

                   if (answer == true) {
                   alert("Application has been canceled!");
                   }
                   else{
                   alert("Book appointment for biometic scan");
                   }

                   </script>
                   </body> </html>
                 Output of the above code is as follows:

















                 When you click on the “OK” button, with the message “this page says”. Then a new window opens:


















                                                 Lab Assignment ‘n Activity                     #Computational Thinking




                   1.  Predict the output of the following code:

                       <HTML>
                       <BODY>
                       <H1> JavaScript </H1>
                       <script type="text/javascript">
                       var a=prompt("Enter a number")
                       alert("The Square is "+a*a)
                       </SCRIPT>
                       </BODY>
                       </HTML>


                                                                                                  JavaScript Part 1  353
   350   351   352   353   354   355   356   357   358   359   360