In the case above, 'this' will refer to the button as it occurs within the scope of the button definition. Each element in a form has a number of properties, two of which were used in the preceding code. They are ' element .value' and ' element .form'. The value of any a textbox, password or textarea element is defined by its content, and by the value property in the case of radio buttons. Checkboxes use the checked property, either true or false.
Select boxes have the selectedIndex property which relates to a value in the options array.
The form property of any form element points up the object hierarchy to the parent form. The event handling code is simply asking its parent form what the value of some other elements are. The relevant hierarchy is displayed in the figure below. As with many programming languages, there is often more than one way to achieve the same result. The following code differs from the previous example in the event handler code and the fact that the form name is used rather than the 'this.form' relationship.