<html>
<link rel="stylesheet" href="josh.css">
<body bgcolor="#FFFFFF">

		<div id="Description">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">switch/case</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">4</span> IE <span class="emphasis">4</span> ECMA <span class="emphasis">3</span></td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements"></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Provides a shortcut to execution paths for numerous conditions of an
expression. The optional <span class="literal">break</span> statement at the
end of each <span class="literal">case</span> block shortcuts execution of the
<span class="literal">switch</span> statement, and also prevents the
inadvertent execution of the <span class="literal">default</span> block, if
present.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="example"><span class="title">Example</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre>var productList = document.forms[0].prodList;
var chosenItem = productList.options[productList.selectedIndex].value;
switch(chosenItem) {
    case "Small Widget":
        document.forms[0].price.value = "44.95";
        break;
    case "Medium Widget":
        document.forms[0].price.value = "54.95";
        break;
    case "Large Widget":
        document.forms[0].price.value = "64.95";
        break;
    default:
        document.forms[0].price.value = "Nothing Selected";
}</pre>
						</span></td>
				</tr>
			</table>
		</div>

</body>
</html>