Page 372 - Webapplication11_C11_Flipbook
P. 372

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





















              Example:

                 <html>
                 <body text="red">
                 <h2> Display numbers from 1 to 10 </h2>

                 <p style="color:blue;">
                 <script>
                 for (i = 1; i <= 10; i++) {

                 document.write(i+"<br><br>"); }
                 </script></p>
                 </body> </html>
              On running the above program, we get the following output:






















              Example:

                 <HTML>
                 <BODY text="red">

                 <H2> program to accept a number and display all even numbers till that number</
                 H2>

                 <P style="color:blue;">
                 <SCRIPT>
                 var num=parseInt(prompt("Enter a number"));

                370     Touchpad Web Applications-XI
   367   368   369   370   371   372   373   374   375   376   377