With Statement
CSGNetwork FREE Source Code, Javascript Source, and Code Snippets!
CSGNetwork Custom Search
     Bookmark and Share
 
CSGNetwork
Snippets
Calculators
Top Free Apps
Home
Back



Right click this window and select "view source" in order to copy the source for this script.

JavaScript Statements

With Statement

Statements Description
with "with" is a time saving statement that allows you to "cache" an object, so for statements that follow, you no longer need to reference the object again when referring to it.

Syntax:

with (object)
statement

Example:

with (document.form1){
field1.value="test"
field2.value="test2"
}

In the above example, the object "document.form1" is cached, so "field1" actually refers to "document.form1.field1".



Bookmark and Share
Registered® Trademark™ and Copyright© 1973 - CSG, Computer Support Group, Inc. and CSGNetwork.Com All Rights Reserved