Wednesday, August 10, 2011


  1. Introduction  1 - 2 - 3
  2. First Program

Here is a single JavaScript statement, which creates a pop-up dialog saying "Hello World!":
  alert("Hello World!");
For the browser to execute the statement, it must be placed inside a <script> element. This element describes which section of the HTML code contains executable code, and will be described in further detail later.
   <script type="text/javascript">
     alert("Hello World!
The <script> element should then be nested inside the <head> element of an HTML document. Assuming the page is viewed in a browser that has JavaScript enabled, the browser will execute (carry out) the statement as the page is loading.
<!DOCTYPE html>
<html lang="en">
    <title>Some Page</title>
    <script type="text/javascript">
      alert("Hello World!");
    <p>The content of the web page.</p>
This basic hello world program can then be used as a starting point for any new programs that you need to create.
Further Notes:
This is how Hello World! would appear to you. It would appear in a dialog box saying Hello World!

No comments:

Post a Comment