Introduction to Javascript for Non-Nerds


How do I describe an object with Properties?

How do I describe an object with Properties?

So, now, we have an HTML file that has a bunch of forms on it each with its own text boxes, checkboxes, buttons, etc, etc. Wonderful. But, just having a web page with that stuff really isn't that exciting. We want to manipulate those objects on the web page so that they are more interactive and more exciting!

So, how do we go about doing this? Well, we use things called Properties. Properties basically define the components of an object. Here's an analogy. Take the example of driving a car. When you drive a car, you aren't just performing one action. To manipulate the car (the car is your Object), you might first push the gas pedal. Then, you might shift gears. Then, you might turn the steering wheel. The gas pedal, gear shift, and steering wheels are all different components of the car that you can perform actions on. They are examples of Properties of the car.

So, what kinds of properties are there for Javascript objects? Well, it depends on the object. For example, the document object has properties such as title, fgColor, and bgColor. These properties describe various aspects of the document object. The title property holds the title of a web page, fgColor holds the foreground color of the web page, and bgColor holds the background color of the web page. Using these and other properties, we can (1) control the behavior of our own web page and (2) detect the behavior of other web pages that the Javascript program encounters.

To get a full listing of Javascript properties, click here


HomeGo to Top Next Page