home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference

Element.form Property


Element.form Property---the Form containing the element


Navigator 2.0, Internet Explorer 3.0




The form property of a form element is a read-only reference to the Form object that contains the specified element.

The form property allows the event handlers of one form element to easily refer to "sibling" elements in the same form. When an event handler is invoked, the this keyword refers to the form element for which it was invoked. Thus, an event handler can use the expression this.form to refer to the form that contains it. From there, it can refer to sibling elements by name, or it can use the elements[] array of the Form object to refer to them by number.

Previous Home Next
Element.focus() Book Index Element.length

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell