| with The with statement adds an object to the scope of every statement nested within its opening and closing braces. It takes an object and refers to all the properties, methods, and events of that object within without actually referencing the object itself. Examine the syntax and the example to get a feel for what this statement can accomplish. syntax: with (referenced object) { statements; } EXAMPLE with (document.forms[0]) { name1 = firstName.value name2 = lastName.value email = email.value } The example shows that through the use of the with statement, the contents of the form referenced in the referenced object field is to have three properties associated with it. Those three properties are in the statements field, and are name1, name2, and email. |