Lesson Two: Adding Design and JavaScript Code

  1. Add the following CSS code to a new file and save the file in your jhistorytree folder as histevents.css.
    body { background-color: tan; font-family: Georgia, "Times New Roman", Times, serif; line-height: 1.6em; }
    h1{ color: maroon; }


  2. Add the following code to a new file and save the file in your jhistorytree folder as histevents.js
    document.write("488 Million Years Ago the Mollusks Appeared");


  3. The word document refers to the document object of your HTML file. The word write is a property (and function/method) of the document object. More on the subject of objects, properties, functions, and methods will be discussed in later lessons.
  4. The function of the write property (method) is to write the parameter that is enclosed in parentheses.
  5. When you are confident that your code is correct: Click File, Save As and save your file in the c:\jhistorytree folder as histevents.js
  6. Double click the histevents.html file to view your webpage: Sample

Lesson Three: Assigning Values to Variables