Although this is not a perfect analogy, sometimes when I am trying to figure
out what an object looks like, I think of objects in terms of
nouns, properties in terms of adjectives, and methods in
terms of verbs.
However, let's consider a more
realistic object that you might have to deal with in your
code. let's consider the HTML FORM "Select Box" object that
we discussed on Day One and which is shown below as a
reminder:
If you recall, a Select Box object
has several properties.
For one, Select Boxes have a SIZE
that corresponds to the number of visible selections.
Select Boxes also can be set to allow either multiple or
single selections. Finally, Select Boxes have a list of
OPTIONS that are tied to an administratively-defined
NAME.
Meanwhile, Select Boxes have
methods.
For example, a select box knows how
to create its popup list when a user clicks on the down
arrow. Also, if a user selects an item from the popup list,
the select box knows how to select that item. Further, the
Select Box knows how to close the popup box when a user
selects an item.
The table below presents a quick
reference to our select box object.