<1> warning box
[Html]
1. 2. 3. <script type = "text/javascript">
4. function disp_alert ()
5 .{
6. alert ("I Am a warning box !! ")
7 .}
8. </script>
9. 10. <body>
11.
12. <input type = "button" onclick = "disp_alert ()" value = "show warning box"/>
13.
14. </body>
15.
<2> confirmation box
[Html]
1. 2. 3. <script type = "text/javascript">
4. function show_confirm ()
5 .{
6. var r = confirm ("Press a button! ");
7. if (r = true)
8 .{
9. alert ("You pressed OK! ");
10 .}
11. else
12 .{
13. alert ("You pressed Cancel! ");
14 .}
15 .}
16. </script>
17. 18. <body>
19.
20. <input type = "button" onclick = "show_confirm ()" value = "Show a confirm box"/>
21.
22. </body>
23.
<3>
[Html]
1. 2. 3. <script type = "text/javascript">
4. function disp_prompt ()
5 .{
6. var name = prompt ("enter your name", "Bill Gates ")
7. if (name! = Null & name! = "")
8 .{
9. document. write ("Hello! "+ Name +" How is today? ")
10 .}
11 .}
12. </script>
13. 14. <body>
15.
16. <input type = "button" onclick = "disp_prompt ()" value = "show prompt box"/>
17.
18. </body>
19.
From sunset hut