Lesson Two: Adding Design and JavaScript Code
- 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; }
- 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");
- 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.
- The function of the write property (method) is to write the parameter that is enclosed in parentheses.
- 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
- Double click the histevents.html file to view your webpage:
Lesson Three: Assigning Values to Variables