In the following example, the form myForm contains a Text object and a button. When the user clicks the button, the value of the Text object is set to the form's name. The button's onClick event handler uses this.form to refer to the parent form, myForm . The following example shows a form with several elements. The following example uses an object reference, rather than the this keyword, to refer to a form.
Parameters event The name of an event for which the specified object has an event handler.
A string specifying the name of this object. Property of Text Implemented in JavaScript 1.0 Security JavaScript 1.1. This property is tainted by default. For information on data tainting, see the Client-Side JavaScript Guide . The name property initially reflects the value of the NAME attribute.