I will now explain to you the fundamental structure of ALL JavaScript codes, because in order to truly understand JavaScript, you'll have to understand the structure of it. Don't worry, I'll clear it up. Using the document object to explain objects. The document object is one of the most important objects of JavaScript. It is the object that controls the layout of a webpage-background color, text, images etc.
Lets have a look at some of the others that the document object possess.
The column on the left are properties of the document object. They are static attributes of the object. Lets say you want to write out the date and time of the last modification to your page onto the screen. Whenever you update your page and save it, this script will display the date and time of this occurrence. Its a static attribute of the current document.