How to change the bgColor of HTML doc with use of switch w/o using function
<p>I want to change the bgColor of my HTML doc with the switch only not with the use of function. 
Plz help. I am a newbie to Javascript. 
My code is like this </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;

var color;
color = parseInt(prompt("Enter the color"));

switch(color)
{
case 1:
        document.bgColor="red";
    break;

case 2:
        document.bgColor="blue";
    break;
case 3:
        document.bgColor="green";
    break;
default :
    alert("invalid");

}


&lt;/script&gt;
&lt;/head&gt;
&lt;/html&gt;
</code></pre>
