December 2001
Intermediate to advanced
480 pages
9h 22m
English
Like the ternary conditional operator, the with statement is a shortcut. Instead of having to list all of the properties of an object by repeating the basic object, you can state the bulk of the object in a with statement and then the properties within the context of the with statement. For example, take a typical form object. First you must state the object as follows:
document.formName... Then you follow with the element names and values:
…elementName.value Thus, your statement would be
document.formName,elementName.value A typical form could include several different elements, such a first name, last name, address, city, state, ZIP code, Social Security number, and all other kinds of property details. Using the
Read now
Unlock full access