Object properties are accessed in natural o-o fashion:
|
var actualSelected = worldMenu.menuSelection;
|
familyMenu.color = 'red';
|
Curiously, in Netscape 2 you can also use array-like notation:
-
familyMenu[0] is same as familyMenu.no
-
familyMenu[1] is same as familyMenu.name etc.
|
We will return to this when we discuss arrays
|
One associates methods with user-defined objects, but with a syntax that appears very limiting since object methods have identical arguments to constructor function
|
General syntax is:
|
ObjectName.methodName = functionName;
|
where ObjectName is an existing object and functionName is an existing function Ñ it can be used to set event handlers with no arguments!
|