JavaScript DHTML/Language Basics/With
Using the with Statement in JavaScript
<source lang="html4strict">
<html> <head>
<title>JavaScript Unleashed</title>
</head> <body>
<script type="text/javascript"> </script>
</body> </html>
</source>
With statement
<source lang="html4strict">
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> inp1 = 1; inp2 = 2; inp3 = 3; with (Math) {
alert("The largest number entered was " + max(inp1, inp2, inp3)); alert("The smallest number entered was " + min(inp1, inp2, inp3));
} </script> </head> <body> </body> </html>
</source>