Items of information that are directly accessible are called the properties of the object. Your web page document is an object. Any table, form, button, image, or link on your page is also an object. For example, the background color of your document is written document.bgcolor. The dot notation can be strung together multiple times.
Most objects have a certain collection of things that they can do.
Different objects can do different things, just as a light can be turned on and off. Events are how we accept input from the user to trigger actions in our Javascript programs. The onClick event, as its name implies, will run the function when the user clicks on the button provided. Other events include OnMouseOver, OnMouseOut, OnFocus, OnBlur, OnLoad, and OnUnload. Lets examine the for loop closely.