Advertisement
RokiAdhytama

Welcome 5 - Chapter 7

Jul 2nd, 2022
937
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.60 KB | None
  1. <html xmlns = "http://www.w3.org/1999/xhtml">
  2.    <head>
  3.       <title>Using Prompt and Alert Boxes</title>
  4.  
  5.       <script type = "text/javascript">
  6.          <!--
  7.          var name; // string entered by the user
  8.  
  9.          // read the name from the prompt box as a string
  10.          name = window.prompt( "Please enter your name", "GalAnt" );
  11.  
  12.          document.writeln( "<h1>Hello " + name +
  13.             ", welcome to JavaScript programming!</h1>" );
  14.          // -->
  15.       </script>
  16.  
  17.    </head>
  18.    
  19.    <body>
  20.       <p>Click Refresh (or Reload) to run this script again.</p>
  21.    </body>
  22. </html>
Advertisement
RAW Paste Data Copied
Advertisement