Assignment 2

# 2 - Your First JavaScript Program

# 2 Review Questions

Back to Main Menu

1. Here are the steps to writing your first JavaScript program.

  1. Set up your desktop.
  2. Open your newAssign.htm document to use as a basic web page by following these simple steps. Save it as 2hello.htm in your folder.
  3. Add the lines of JavaScript to display "Hello World".
  4. Check by opening the file "2hello.htm" in your browser and HOPE it works. If not, study any parts that look wrong and try to fix it so it works right. Don't try to add too much fancy stuff for this program, since we will get to learn more features as we go. If you are really stuck about how to make it work, click on this link, but not until you have REALLY tried. Don't click here until you have tried it for yourself.

2. Here is another task for you to try.

Use the 'window.status()' method to echo the phrase "Hello World" in the status bar of your web page's browser window. Add

window.status="Hello World";

inside the <SCRIPT> tags and view the page again to see the changes in the status bar.

Return to Top of Page | Back to Main Menu