Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 80 - 2609_Logicode
P. 80

    Code
                           7        Create a web page to demonstrate the use of Confirm Box in JavaScript.

                      <!DOCTYPE HTML>
                      <HTML>
                      <HEAD>

                      <TITLE>Confirm Box</TITLE>
                      </HEAD>
                      <BODY>

                      <H1>File Status</H1>
                      <SCRIPT>
                      {

                      let result = confirm("Are you sure you want to delete this file?");
                      if(result)

                      {
                      document.write("File deleted!");
                      }

                      else
                      {

                      document.write("File not deleted.");
                      }
                      }
                      </SCRIPT>

                      </BODY>
                      </HTML>
                      The output of the preceding HTML code is as follows:

                       78   Premium Edition-VIII

| 75 76 77 78 79 80 81 82 83 84 85 |