Javascript Lesson 4

Goto Lesson:

Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
As already stated Javascript is very good at performing algebraic functions, swapping stuff and so forth. What good is that though if you cannot apply it to the page. This is where the DOM (Document Object Model) comes into play. It is a heirarchy of the way items are arranged on a page and how to access them. The heirarchy goes as follows:

Window-->Document-->Item-->option

That means to access and item you would use window.document.ITEMNAME.OPTIONNAME. In Some case you may have subitems or options that will extend your code. Please note that window is unnecessary if accessing stuff in the same window. So once you have calculated what to do it can be updated with the DOM. We will see some examples of this in the next lesson.